国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

幫助中心 >  技術(shù)知識庫 >  數據庫 >  數據庫管理 >  linux遠程連接Mysql數據庫的問(wèn)題(ERROR 2003 (HY000)

linux遠程連接Mysql數據庫的問(wèn)題(ERROR 2003 (HY000)

2016-03-07 17:04:39 7383

在我們用客戶(hù)端及其遠程連接服務(wù)器Mysql數據庫的過(guò)程中,容易出現下面問(wèn)題: 
問(wèn)題代碼代碼 
ERROR 2003 (HY000): Cant connect to MySQL server on 192.168.0.19 (111)  

ERROR 2003 (HY000): Cant connect to MySQL server on 192.168.0.19 (111)      

這個(gè) 原因就是Mysql數據庫的默認配置文件my.cnf(linux下)中的bind-address默認為127.0.0.1,所以就算你創(chuàng )建了可以 remote訪(fǎng)問(wèn)的用戶(hù),你也不能使用mysql -h命令進(jìn)行訪(fǎng)問(wèn),若訪(fǎng)問(wèn)就會(huì )出現上出問(wèn)題,因為此時(shí)Mysql只接受localhost,所以需要把bind-address屏蔽掉。

my.cnf一般在/etc/mysql下面,如果不在使用locate my.cnf查找,修改前的my.cnf配置文件為:
修改前的my.cnf配置文件代碼 
#  
# Instead of skip-networking the default is now to listen only on  
# localhost which is more compatible and is not less secure.  
bind-address           = 127.0.0.1  
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address           = 127.0.0.1
我們需要做的就是屏蔽這個(gè)bind-address代碼,屏蔽后代碼為:
屏蔽后my.cnf配置文件代碼 
#  
# Instead of skip-networking the default is now to listen only on  
# localhost which is more compatible and is not less secure.  
#bind-address           = 127.0.0.1  
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127.0.0.1
現在你就可以用mysql -h命令進(jìn)行你想做的操作了,如登錄系統:
登陸數據庫代碼 
mysql -h 192.168.0.19 -u root -p 

提交成功!非常感謝您的反饋,我們會(huì )繼續努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題:
-->