Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Hubert 1 post 71 karma points
    Jun 20, 2016 @ 12:12
    Hubert
    0

    MySQL database connection

    Hi, support long thinking on solution this problem, so may you guys can help me. I want to add additional external database (it will be MySQL from Azure).

    I done it on my local computer (it's working great!) but when I putted it to dev stage it doesn't work.

    I catch exception:

    "System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. 
    This usually means that the connection to the database failed. 
    Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file.
    
     See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. 
     See the inner exception for details of the failure. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts.\r\n   at MySql.Data.MySqlClient.NativeDriver.Open()\r\n   at MySql.Data.MySqlClient.Driver.Open()\r\n   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)\r\n   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()\r\n   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()\r\n   at MySql.Data.MySqlClient.MySqlPool.GetConnection()\r\n   at MySql.Data.MySqlClient.MySqlConnection.Open()\r\n   at MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection)\r\n   at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)\r\n   
     --- End of inner exception stack trace ---\r\n   at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)\r\n   at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)\r\n   
    
     --- End of inner exception stack trace ---\r\n   at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)\r\n   at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.<>c__DisplayClass1.<ResolveManifestToken>b__0(Tuple`3 k)\r\n   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\r\n   at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection)\r\n   at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)\r\n   at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)\r\n   at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)\r\n   at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)\r\n   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()\r\n   at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext()\r\n   at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsync[TElement](String sql, Nullable`1 streaming, Object[] parameters)\r\n   at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIDbAsyncEnumerator[TElement](String sql, Nullable`1 streaming, Object[] parameters)\r\n   at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsync(Type elementType, String sql, Nullable`1 streaming, Object[] parameters)\r\n   at System.Data.Entity.Internal.InternalSqlNonSetQuery.GetAsyncEnumerator()\r\n   at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.System.Data.Entity.Infrastructure.IDbAsyncEnumerable<TElement>.GetAsyncEnumerator()\r\n   at System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ForEachAsync[T](IDbAsyncEnumerable`1 source, Action`1 action, CancellationToken cancellationToken)\r\n   at System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ToListAsync[T](IDbAsyncEnumerable`1 source, CancellationToken cancellationToken)\r\n   at System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.ToListAsync[T](IDbAsyncEnumerable`1 source)\r\n   at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.ToListAsync()\r\n   at SQLRepository.<GetSumEnergyAndCoordinateForRegions>d__0.MoveNext() in c:\\inetpub\\temp\\DWASFiles\\sites\\...\\VirtualDirectory0\\site\\wwwroot\\App_Code\\Database\\Repositories\\SQLRepository.cs:line 13\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at ZipCodeController.<GetEnergySumForZipCodes>d__0.MoveNext() in c:\\inetpub\\temp\\DWASFiles\\sites\\...\\VirtualDirectory0\\site\\wwwroot\\App_Code\\Controllers\\ZipCodeController.cs:line 1
    

    Do you have any idea, solution for that?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies