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) 完美解决!

相关推荐
+VX:Fegn089515 小时前
人力资源管理|基于springboot + vue人力资源管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·课程设计
姓蔡小朋友15 小时前
Redis内存回收
前端·数据库·redis
TDengine (老段)15 小时前
TDengine 地理函数 ST_GeomFromText 用户手册
大数据·数据库·物联网·时序数据库·tdengine·涛思数据
一 乐15 小时前
海鲜商城购物|基于SprinBoot+vue的海鲜商城系统(源码+数据库+文档)
前端·javascript·数据库·vue.js·spring boot
西岭千秋雪_15 小时前
MySQL日志梳理(服务器层)
java·运维·服务器·数据库·mysql
boy快快长大16 小时前
【Spring Cloud Alibaba】Gateway(一)
数据库·gateway
Apache IoTDB16 小时前
祝贺朱雀三号首飞成功入轨!国产时序数据库 IoTDB 助力火箭试验
数据库·时序数据库·iotdb
dragoooon3416 小时前
[C++——lesson14.STL 学习——【string的使用】]
数据库·oracle
羑悻的小杀马特16 小时前
Stream消息队列+地理空间计算+HyperLogLog去重,SCAN安全遍历+RESP协议全解析,一文把它啃透!
数据库·redis·安全·缓存·空间计算·resp
ao_lang16 小时前
MySQL--多版本并发控制(MVCC)
数据库·mysql