多个来自Docker的Mysql连接 – >套接字错误

我目前尝试从虚拟机迁移到Docker Windows容器。 容器是Windows Server 2016 Datacenter上的宿主。 操作系统安装在由Hetzner托pipe的物理根计算机上。 我的Docker容器包含一个控制台应用程序,用C#编写,在Maria-Cloud上托pipe的MariaDB数据库上执行更新。

在每个控制台应用程序运行在一个独立的虚拟机与自己的ipv4之前。 现在他们在容器中运行,并得到以下exception

Unhandled Exception: System.TypeInitializationException: The type initializer for 'AC' threw an exception. ---> MySql.Data.MySqlClient.MySqlException: Authentication to host '##.##.##.##' for user '####' using method 'mysql_native_password' failed with message: Reading from the stream has failed. ---> MySql.Data.MySqlClient.MySqlException: Reading from the stream has failed. ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream. at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count) at MySql.Data.MySqlClient.MySqlStream.LoadPacket() --- End of inner exception stack trace --- at MySql.Data.MySqlClient.MySqlStream.LoadPacket() at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket() --- End of inner exception stack trace --- at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationFailed(Exception ex) at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket() at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset) at MySql.Data.MySqlClient.NativeDriver.Authenticate(String authMethod, Boolean reset) at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at ServiceStack.OrmLite.OrmLiteConnection.Open() at ServiceStack.OrmLite.OrmLiteConnectionFactory.OpenDbConnection() at ACb() at AC.cctor() --- End of inner exception stack trace --- at ACA() at Ab.ctor() at AaA() at AdA(String[] ) at Ada[A](String[] ) at AAA(String[] ) 

Docker使用NATnetworking。 因此,我认为有关来自同一IP的多个连接的连接存在问题。

有没有人有类似的经验,或知道如何解决这个问题? 我有点困惑,很高兴有任何帮助。 提前致谢。

如果您有任何关于我的设置或其他任何问题,请让我知道。

问候迈克尔