錯誤碼: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

 

成功解決!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM