错误2003(HY000):无法连接到"127.0.0.1"上的MySQL服务器(111) [英] ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

查看:144
本文介绍了错误2003(HY000):无法连接到"127.0.0.1"上的MySQL服务器(111)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下命令:

mysql -u root -h 127.0.0.1 -p

,错误消息是:

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

谁可以帮助我进行修复?

Who can help me to fix it?

推荐答案

如果使用的是ubuntu,则必须使用以下步骤来避免此错误(如果未启用复制):

If you are using ubuntu, you have to use the following steps to avoid this error(if there is no replication enabled):

  1. 运行命令vim /etc/mysql/my.cnf
  2. 使用#符号注释bind-address = 127.0.0.1
  3. 重新启动您的mysql服务器一次.
  1. run the command vim /etc/mysql/my.cnf
  2. comment bind-address = 127.0.0.1 using the # symbol
  3. restart your mysql server once.

更新

在步骤1中,如果在my.cnf文件中找不到bind-address,请在/etc/mysql/mysql.conf.d/mysqld.cnf文件中查找.

In Step 1, if you cannot find bind-address in the my.cnf file, look for it in /etc/mysql/mysql.conf.d/mysqld.cnf file.

在启用MySQL复制的情况下进行更新

尝试在IP上连接MySQL服务器,该服务器已在'my.cnf instead of localhost或127.0.0.1`中绑定了MySQL服务器.

Try to connect MySQL server on IP for which MySQL server is bind in 'my.cnfinstead oflocalhost or 127.0.0.1`.

这篇关于错误2003(HY000):无法连接到"127.0.0.1"上的MySQL服务器(111)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆