ERROR 2003 (HY000): Can#39;t connect to MySQL server on #39;127.0.0.1#39; (111)(错误 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):
- 运行命令
vim/etc/mysql/my.cnf - 注释
bind-address = 127.0.0.1使用 # 符号 - 重启你的 mysql 服务器一次.
更新
在第一步中,如果在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服务器,MySQL服务器绑定在'my.cnf而不是localhost或127.0.0.1`中.
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 2003 (HY000):无法连接到“127.0.0.1"上的 MySQL 服务器 (111)
基础教程推荐
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在多列上分布任意行 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
