我在远程托管提供商上拥有此 Mysql 数据库。我安装了 MySql 工作台并包含以下信息:
server,
username,
pw
它连接正常,但是当我尝试使用 Visualstudio 时,我收到此错误
我正在使用 MySql 网站上的 MySql 连接器。此外,当尝试使用 EntityFramework 中的以下连接字符串进行连接时
Server=tango.rdb.superhosting.bg;Database=ulprojec_weatheronmars;Uid=ulpro_georgi_it;Pwd=password;
我收到以下错误
An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
并且仍然通过 MySql 工作台我可以执行 LINQ 等。
最佳答案
根据您的 Visual Studio 屏幕截图,您正在尝试连接 Sql Server 驱动程序。您应该使用 MySql 驱动程序。我的猜测是您正在对 Entity Framework 执行相同的操作。
免责声明:我没有使用过 MySql,所以我不知道从哪里获取驱动程序。我确信 Google 会知道。
关于C#和EF无法连接到远程MySql服务器,但MySql工作台可以连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15958847/