Unable to connect to any of the specified MySQL nodes - MySQL 6.8.3 connector and ASP MVC5

After a whole day trying to find dozens of solutions, I really got stuck here. I get the notorious Unable to connect to any of the specified MySQL host errors. This is a very common mistake, so I already tried a few things. First, some details that hopefully help:

I use:

  • Entity Framework 6
  • ASP.NET MVC 5
  • MySQL with MySQL Connector 6.8.3

Everything works when I run the application in Visual Studio 2013. It connects to the MySQL server without any problems, so I suppose nothing happened to my connection string. However, when deploying my application, I get this error. I thought maybe because my level of trust in shared hosting was set to Medium, however I contacted my hosting provider and they said it was set to Full. Pages that do not use the database are displayed correctly.

Here's the error stack trace:

[MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.]
   MySql.Data.MySqlClient.NativeDriver.Open() +1285
   MySql.Data.MySqlClient.Driver.Open() +260
   MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +269
   MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() +18
   MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +403
   MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() +228
   MySql.Data.MySqlClient.MySqlPool.GetConnection() +106
   MySql.Data.MySqlClient.MySqlConnection.Open() +1579
   MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +186
  System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +118

[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
   System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +459
   System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +118
   System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +94
   System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +248
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +618
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +72
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +64
   System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +85
   DailyMusic.Models.DAL.ReviewRepository.GetMostRecentReviews(Int32 number) +487
   DailyMusic.Controllers.HomeController.Index() +21
   lambda_method(Closure , ControllerBase , Object[] ) +79
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__36(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c() +112
   System.Web.Mvc.Async.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e() +452
   System.Web.Mvc.Async.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult) +15
   System.Web.Mvc.Async.<>c__DisplayClass28.<BeginInvokeAction>b__19() +37
   System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +241
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +51
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
0
source share
2 answers

A few hours later I found a solution. This is quite specific, but perhaps there are others in the same situation.

: . , , Visual Studio, . , , .

+3

@Jenthe, . , RDS Amazon AWS , , :

1) https://console.aws.amazon.com/ec2/v2/

2)

3)

4) ( 3306, mysql)

enter image description here

5) > a >

6) ""

7)

0

Source: https://habr.com/ru/post/1599687/


All Articles