The provider did not return a ProviderManifestToken string error

后端 未结 8 846
失恋的感觉
失恋的感觉 2021-02-12 20:54

I am trying to create a web app using ASP.Net MVC3, Entity Framework and MySQL.

I have added the following code to my Web.Config file.



        
相关标签:
8条回答
  • 2021-02-12 21:33

    I got this error when my sql server was actually down. So, please be sure that your sql server is up and running.

    0 讨论(0)
  • 2021-02-12 21:40

    Restarting the computer worked for me.

    While this message was showing, I did not find any differences between my computer [Windows 10] and the test server where the the application was deployed with the same configuration and was working correctly there and using the same database. It means the issue was probably not connected to the database running on the test server.

    Worth mentioning is there were some Windows updates pending while restarting.

    0 讨论(0)
  • 2021-02-12 21:41

    The problem was with the MySQL connector/Net.

    I previously used MySQL connector/Net 6.3.5 and after I uninstalled it and installed MySQL connector/Net 6.5.4 the issue was fixed. You can find latest connectors at http://www.mysql.com/products/connector/

    0 讨论(0)
  • 2021-02-12 21:45

    Sometimes this issue arises because of sslmode as well, For me the solution was to add sslmode=None to connection string

    I had to make a small change to my connection string from

    <add name="Connection" connectionString="Server=SOMEHOST;Database=DB;Uid=USR1;Pwd=PASS1;" providerName="MySql.Data.MySqlClient" />
    

    to

    <add name="Connection" connectionString="Server=SOMEHOST;Database=DB;Uid=USR1;Pwd=PASS1;sslmode=None;" providerName="MySql.Data.MySqlClient" />
    
    0 讨论(0)
  • 2021-02-12 21:50

    I know this may be very basic for a couple of you guys, but this exception is also thrown in cases where EF is unable to locate a Connection String to use. If you-re working in a multi-layered application, make sure the connection String is added to your client application, instead of the class library that contains you data access code. Just my 2 cents.

    0 讨论(0)
  • 2021-02-12 21:51

    You can also get this error if you upgrade Nuget references in an EntityFramework project that uses MySql.Data.Entity (latest version is 6.10.X) and MySql.Data (latest version is 8.0.X). Those version numbers should match. You should use the MySql.Data.EntityFramework package with MySql.Data version 8.0 and after, and the MySql.Data.Entity package with versions 6.10 and before.

    There are a lot more details in this blog post: https://davidsekar.com/asp-net/mysql-error-the-provider-did-not-return-a-providermanifesttoken

    0 讨论(0)
提交回复
热议问题