ERROR 2003 (HY000): Can't connect to MySQL server on "host" (111)

默认情况下Mysql只允许本地登录,所以需要修改配置文件将地址绑定给注释掉:

vim /etc/mysql/my.cnf

# Instead of skip-networking the default is now to listen onlyon
# localhost which is more compatible and is not less secure.
#bind-address 
         = 127.0.0.1 <---注释掉这一行就可以远程登录了



  • 文章声明
  • 作者:Owen
  • 出处: http://www.cnblogs.com/owenyang
  • 本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。该博客同步发在 HEXO-博客
  • 原文地址:https://www.cnblogs.com/owenyang/p/3579064.html