gpt4 book ai didi

MySQL "Unable to connect to host [host] because access was denied."

转载 作者:行者123 更新时间:2023-11-30 01:33:00 27 4
gpt4 key购买 nike

我在远程连接到 MySQL 服务器时遇到问题。我知道我的用户设置了来自任何主机的“%”通配符,因此我应该有权访问服务器。我可以使用我的凭据本地登录 MySQL 服务器,但不能远程登录。

我在 my.cnf 中的设置如下所示:

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld]
user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#
bind-address = 128.xxx.xxx.xxx

我正在使用以下参数进行连接(使用 Coda2 GUI - 但问题似乎与 Coda2 无关):

Server: 128.xxx.xxx.xxx
Port: 3306
Username: sadmicrowave
Password: my_mysql_password

发布的完整错误消息是:

 Unable to connect to host uslonsweb003 because access was denied.
Double-check your username and password and ensure that access from your current location is permitted.

MySQL said: Access denied for user 'sadmicrowave'@'128.xxx.xxx.xxx' (using password: YES)

我可以使用 IP 地址和 3306 远程登录到我的服务器,因此我知道服务器正在监听该端口...

这到底是怎么回事?

最佳答案

您是否发布了the flush privileges授予通配符用户访问权限后?

如果您添加一个带有 user = Sadmicrowave 且主机 = [您的实际 ip] 的条目(不要忘记在添加用户后发出刷新权限命令),会发生什么?

关于MySQL "Unable to connect to host [host] because access was denied.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17224788/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com