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

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


解决办法:


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


# vi /etc/mysql/my.cnf


按a或i进入编辑模式


#bind-address           = 127.0.0.1  (默认没注释)


按Esc键退出编辑模式


:wq (退出并保存)


# service mysql restart


你可能感兴趣的:(error,2003,(HY000))