錯誤碼:2003 不能連接到 MySQL 服務器在 (10061)

錯誤碼:2003 不能連接到 MySQL 服務器在 (10061)

今天在ubuntu上安裝了mysql服務器,在windows上用客戶端軟件連接mysql服務器時,出現錯誤:

錯誤碼:2003 不能連接到 MySQL 服務器在 (10061) 

折騰來折騰去沒搞好,防火牆也關了,3306端口也添加到了出站規則,但就是連不上,後來無意間看到一篇帖子,得到了提示。打開/etc/mysql/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
#

也就是說mysql服務器默認綁定了127.0.0.1端口,這樣其他遠程客戶端當然無權訪問啦,我們這裏把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服務:

sudo restart mysql

您再試一下,保證木問題。

發佈了235 篇原創文章 · 獲贊 3495 · 訪問量 131萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章