我在远程连接到我的 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 远程登录到我的服务器,所以我知道服务器正在侦听该端口...
到底他妈发生了什么?