【问题标题】:Access denied error in C# while connecting with MySql. I already have full access of Database连接 MySql 时 C# 中的访问被拒绝错误。我已经拥有数据库的完全访问权限
【发布时间】:2013-12-05 22:36:27
【问题描述】:

您好,我正在开发和应用程序,我需要使用 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)

【问题讨论】:

  • 服务器可能不允许远程连接;假设凭据实际上是正确的。
  • @Michael Perrenoud 服务器允许远程连接。我用 PHP 试过了,效果很好。
  • 是否需要 HTTPS?

标签: c# mysql connection-string


【解决方案1】:

您没有提到有关远程服务器的详细信息。如果您使用包含 MySQL 数据库的第三方远程服务器,请确保它支持远程访问。您可以在 MySQL 工作台上查看它。尝试在 MySQL 工作台上连接相同的数据库。

【讨论】:

    【解决方案2】:

    可能sql-server不允许来自非服务器ip地址的连接,或者你被禁止使用非服务器ip地址连接数据库。检查您的权限。可能是您的权限被授予 username@localhost 而不是 username@*

    【讨论】:

      猜你喜欢
      • 2023-03-21
      • 2020-03-10
      • 1970-01-01
      • 2012-12-05
      • 2015-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多