2013-06-20 94 views
0

我有一個遠程連接到我的MySQL服務器的問題。我知道我的用戶使用任何主機的'%'通配符設置,所以我應該可以訪問服務器。我可以用我的憑證本地登錄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 

而且我用下面的PARAMS連接(使用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這樣telnet到我的服務器我知道服務器正在偵聽該端口...

這是怎麼回事?

回答

0

您授予訪問通配符用戶後是否發佈了the flush privileges

如果添加一個條目user = sadmicrowave和host = [你的實際IP](添加用戶後不要忘記發出flush privileges命令),會發生什麼?

+0

我已經重新啓動,因爲用戶名添加,這(從我讀過的)將執行與flush命令相同的事情。 – sadmicrowave

+0

我肯定會嘗試添加用戶作爲主機的本地IP,看看它做了什麼。 – blowdoof

相關問題