【问题标题】:MySQL - VB - Connection Error ReportViewerMySQL - VB - 连接错误 ReportViewer
【发布时间】:2017-06-17 02:44:14
【问题描述】:

我正在使用报告查看器表单进行报告。

当我尝试打开连接时返回一个错误。

这是错误:

 MySql.Data.MySqlClient.MySqlException occurred

  HResult=0x80004005
  Message=Authentication to host '' for user '' using method 'mysql_native_password' failed with message: Access denied for user ''@'fe80::289c:18c7:6714:8608%2' (using password: NO)

Inner Exception 1:
MySqlException: Access denied for user ''@'fe80::289c:18c7:6714:8608%2' (using password: NO)

除此之外,所有其他连接都正常。

代码错误:

myAdapter.SelectCommand = New MySqlCommand("SELECT * FROM Stock", conn)

myAdapter.Fill(dbDataSet.Tables(0))

连接:

Dim conn As New MySqlConnection
        conn = New MySqlConnection()
        conn.ConnectionString = "server=localhost;user id=root;password=;database=Empresa;"

谁能告诉我我做错了什么?

已经尝试过这个(Host xxxx is not allowed to connect to this MySQL server),但现在错误变成了这个。

感谢您的帮助,谢谢。

【问题讨论】:

    标签: mysql vb.net visual-studio report


    【解决方案1】:

    你的安全不太对。 Mysql 允许/默认将用户绑定到一个地址。见下文:

    https://serverfault.com/q/257513/219898

    https://stackoverflow.com/a/3552946/1662973

    如果它只是本地的,你也可以考虑关闭 IPV6 - 我看到它绑定到那个。

    【讨论】:

    • 网络适配器设置 - 有一个复选框。不理会 IPV4,但取消选中 IPV6。
    • 谢谢。它有效,但现在告诉我:“MySql.Data.MySqlClient.MySqlException: 'No database selected'”
    • 确保用户有权访问数据库。授予 * 上的所有特权。 * TO 'newuser'@'localhost';
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-10
    • 2017-01-08
    • 2014-07-07
    • 2016-10-27
    • 2014-12-03
    • 2016-09-10
    • 2017-09-07
    相关资源
    最近更新 更多