詳解長途銜接Mysql數據庫的成績(ERROR 2003 (HY000))。本站提示廣大學習愛好者:(詳解長途銜接Mysql數據庫的成績(ERROR 2003 (HY000)))文章只能為提供參考,不一定能成為您想要的結果。以下是詳解長途銜接Mysql數據庫的成績(ERROR 2003 (HY000))正文
在我們用客戶端及其長途銜接辦事器Mysql數據庫的進程中,輕易湧現上面成績:
成績代碼代碼
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.19' (111)
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.19' (111) 這個 緣由就是Mysql數據庫的默許設置裝備擺設文件my.cnf(linux下)中的bind-address默許為127.0.0.1,所以就算你創立了可以 remote拜訪的用戶,你也不克不及應用mysql -h敕令停止拜訪,若拜訪就會湧現上出成績,由於此時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
我們須要做的就是屏障這個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敕令停止你想做的操作了,如登錄體系:
上岸數據庫代碼
mysql -h 192.168.0.19 -u root -p