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

相关推荐
青春:一叶知秋10 小时前
【Redis存储】渐进式遍历和数据库管理
数据库·redis·缓存
不会c嘎嘎10 小时前
MySQL -- 基本查询
数据库·mysql
p***h64310 小时前
从无到有:MongoDB事务的演进之路
数据库·mongodb
E***U94511 小时前
MySQL自然语言处理应用
数据库·mysql
计算机毕业设计小途11 小时前
计算机毕业设计推荐:基于SpringBoot的水产养殖管理系统【Java+spring boot+MySQL、Java项目、Java毕设、Java项目定制定做】
java·spring boot·mysql
洛_尘12 小时前
MySQL 2:库的操作
数据库·mysql
码农101号12 小时前
Linux - 达梦数据库的安装
数据库
l1t12 小时前
使用DuckDB SQL求解Advent of Code 2024第9题 磁盘碎片整理
数据库·sql·算法·duckdb·advent of code
光之梦12 小时前
《openGauss全密态与防篡改账本数据库:云上数据安全与可信的新范式》
mysql
Z***u65913 小时前
MySQL物联网开发
数据库·mysql