我正在尝试将 Entity Framework 逆向工程代码优先与 MySQL DB 结合使用,我已经安装了这些:mysql-for-visualstudio-1.2.3 和 mysql-connector-net-6.9.3
与 MySQL DB 的连接似乎有效:
我收到以下错误:
System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> MySql.Data.MySqlClient.MySqlException: Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'@'localhost' (using password: NO) ---> MySql.Data.MySqlClient.MySqlException: Access denied for user 'root'@'localhost' (using password: NO)
我尝试了很多在互联网上找到的解决方案,但没有任何效果。
这是我在 web.config 中的连接字符串:
<add name="TFEContext" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;
port=3306;database=tfe_schema;uid=root;password=********"/>
最佳答案
经过 2 天的搜索,我选中了“保存我的密码”框,它可以正常工作,但访问 MySQL 服务器的密码是硬编码在 web.config 中的。
关于mysql - Entity Framework 和逆向工程 Code First 和 MySQL : error access denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25824959/