MySQL“无法连接到主机[主机],因为访问被拒绝。”

时间:2021-10-20 04:42:26

I'm having an issue connecting remotely to my MySQL server. I know my user is setup with the '%' wildcard from any host, so I should have access to the server. I can log in locally on the MySQL server with my credentials, just not remotely.

我在远程连接MySQL服务器时遇到问题。我知道我的用户使用来自任何主机的'%'通配符进行设置,因此我应该可以访问服务器。我可以使用我的凭据在MySQL服务器上本地登录,而不是远程登录。

My settings in my.cnf look like this:

我在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

And I'm connecting with the following params (using Coda2 GUI -- but the problem doesn't seem related to Coda2):

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

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

The full error message posted is:

发布的完整错误消息是:

 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)

I can telnet to my server using IP address and 3306 so I know the server is listening on that port...

我可以使用IP地址和3306 telnet到我的服务器所以我知道服务器正在监听该端口...

What the heck is going on?

到底他妈发生了什么?

1 个解决方案

#1


0  

Did you issued the flush privileges after granting access to the wildcard user?

您是否在授予对通配符用户的访问权限后发出了刷新权限?

What happens if you add an entry with user = sadmicrowave and host = [your actual ip] (don't forget to issue the flush privileges command after adding the user) ?

如果你添加一个user = sadmicrowave和host = [你的实际ip]的条目会发生什么(添加用户后不要忘记发出flush特权命令)?

#1


0  

Did you issued the flush privileges after granting access to the wildcard user?

您是否在授予对通配符用户的访问权限后发出了刷新权限?

What happens if you add an entry with user = sadmicrowave and host = [your actual ip] (don't forget to issue the flush privileges command after adding the user) ?

如果你添加一个user = sadmicrowave和host = [你的实际ip]的条目会发生什么(添加用户后不要忘记发出flush特权命令)?