您好,我正在开发应用程序,我需要使用 IP 地址连接到远程服务器上的 MySQL 数据库。
我使用了以下连接字符串:
<connectionStrings>
<add name="con" connectionString="Server=***.***.***.***;Port=3306;Database=enview;Uid=myuser;Pwd=****" providerName="MySql.Data.MySqlClient"/>
当我尝试打开连接时出现以下错误。
Authentication to host '***.***.***.***' for user 'myuser' using method 'mysql_native_password' failed with message: Access denied for user 'myuser'@'**my IP**' (using password: YES)
最佳答案
可能sql-server不允许来自非服务器ip地址的连接,或者你被禁止使用非服务器ip地址连接到数据库。检查您的权限。可能是您的权限被授予 username@localhost 而不是 username@*
关于c# - 与 MySql 连接时,C# 中的访问被拒绝错误。我已经拥有数据库的完全访问权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20121290/