MySQL报ERROR 2002 (HY000)解决

今天在连接客户服务器时MySQL的时候报:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2)

root@XXX \~\]# mysql -uroot -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2) ## 解决方案: 在登录MySQL数据库的时候用一下命令 ```sql mysql -h 127.0.0.1 -uroot -p ``` \[root@XXX \~\]# mysql -h 127.0.0.1 -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 7812 Server version: 5.7.18-log Source distribution Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. mysql\> ![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/9434fa39dae44445bd35fbdd063ed925.png) 完美解决!

相关推荐
.小小陈.11 分钟前
MySQL 高频考点:表连接与索引全解析
数据库
阳光九叶草LXGZXJ20 分钟前
达梦数据库-学习-57-读写数据页超时告警排查(page[x,x,xxxxxx] disk write uses)-DSC集群版
linux·运维·服务器·数据库·sql·学习
Omics Pro23 分钟前
前沿学科:量子生物学!
大数据·数据库·人工智能·windows·redis·量子计算
Ggsddu11122233331 分钟前
制造企业MES系统推荐:2026年MES选型指南与主流系统深度评测
mysql·制造
Java成神之路-36 分钟前
MySQL 参数 completion_type 深入浅出:搞懂事务提交后的“隐藏动作”
mysql
霸道流氓气质36 分钟前
Spring 事务提交后执行异步操作:原理、陷阱与最佳实践
数据库·spring
无小道37 分钟前
Redis——list相关指令
数据库·redis·缓存
阳光九叶草LXGZXJ39 分钟前
达梦数据库-堆栈看问题-01-asmapi_asm_extent_load
linux·运维·数据库·sql·学习
你的保护色43 分钟前
ensp之STP、RSTP、MSTP协议实验
java·服务器·数据库
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ1 小时前
获取容器mysql管理员密码命令
数据库·mysql