Unable to connect to any of the specified MySQL hosts when I publish ABP to Ubuntu with Docker

0

I've tried to publish My Asp Boilerplate project to Ubuntu using Docker , but I got a problem. Unable to connect to any of the specified MySQL hosts.

--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
**crit:** Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception
MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
   at MySqlConnector.Core.ServerSession.<ConnectAsync>d__56.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\Core\ServerSession.cs:line 239
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MySql.Data.MySqlClient.MySqlConnection.<CreateSessionAsync>d__77.MoveNext() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlConnection.cs:line 365

Here's my connection,

 {
      "ConnectionStrings": {
        "Default": "Server=128.199.250.219; Database=CityInfoDb; User Id=****; Password=******;"
      },
      "App": {
        "WebSiteRootAddress": "http://localhost:9903/"
      }
    }

My Docker file , dockerfile

Mysql , mysql

Maybe my dockerfile incorrect , Please help me I'm frustated.

c#
asp.net
asp.net-core
asp.net-core-2.0
asp.net-boilerplate
asked on Stack Overflow Mar 14, 2018 by Yogi Chandra • edited Mar 14, 2018 by Yogi Chandra

1 Answer

0

Your connection string seems to be incorrect, please find below the example.

{

"ConnectionStrings": {
"Default": "server=127.0.0.1;uid=root;pwd=1234;database=mysqldemodb"
},
 ...
}

You can refer EF Core MySql Integration.

answered on Stack Overflow Mar 14, 2018 by vivek nuna

User contributions licensed under CC BY-SA 3.0