【问题标题】:MySQL needs IP however im running it in my own computerMySQL需要IP但是我在我自己的电脑上运行它
【发布时间】:2016-02-13 02:49:54
【问题描述】:

我正在使用功能齐全的 SMS 应用程序执行单元测试。我在运行单元测试时遇到了这个问题。

如果我只是在我自己的电脑上使用 mysql,谁能向我解释为什么我需要一个 ip?我显然使用 localhost、root 和 admin。那么为什么我还需要这样的IP地址呢?任何人都可以解释一下急需。

我在您提出答案之前就开始添加这些代码

"CREATE user '" & txtUsername.Text & "'@'" & txtServer.Text & "' IDENTIFIED BY '" & txtPassword.Text & "';"
"GRANT ALL PRIVILEGES ON *.* TO '" & txtUsername.Text & "'@'" & txtServer.Text & "' identified by '" & txtPassword.Text & "' WITH GRANT OPTION;"
"CREATE user '" & txtUsername.Text & "'@'%' IDENTIFIED BY '" & txtPassword.Text & "';"
"GRANT ALL PRIVILEGES ON *.* TO '" & txtUsername.Text & "'@'%' identified by '" & txtPassword.Text & "' WITH GRANT OPTION;"
"FLUSH PRIVILEGES;"

然后我想出了这个问题。我不知道先做什么

谁能帮帮我:'(

【问题讨论】:

    标签: mysql database vb.net unit-testing testing


    【解决方案1】:

    您的 MySQL 服务器配置为仅接受来自 localhost 的连接,其 IP 地址应为 127.0.0.1。

    您的客户端软件正在使用您主机的硬件网络接口,其 IP 地址为 192.168.8.102。这与 localhost 不同 - 至少它不应该在正确配置的系统上。

    您需要告诉您的客户端使用 127.0.0.1 作为其 IP 地址。

    【讨论】:

    • 我又遇到了另一个问题。有什么建议么。非常需要它
    猜你喜欢
    • 1970-01-01
    • 2021-05-12
    • 2022-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 2019-07-16
    相关资源
    最近更新 更多