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

相关推荐
NineData27 分钟前
杭州 OpenClaw 开发者聚会来了!NineData 叶正盛将带来主题分享
数据库·人工智能
wang2455981992 小时前
【MySQL基础篇】概述及SQL指令:DDL及DML
sql·mysql·oracle
2401_898075122 小时前
Python在金融科技(FinTech)中的应用
jvm·数据库·python
IvorySQL3 小时前
PostgreSQL 技术日报 (3月14日)|AI 落地 PostgreSQL 拒绝 PPT 空谈
数据库·postgresql·开源
JavaGuide3 小时前
鹅厂面试:SELECT * 一定导致索引失效?常见索引失效场景有哪些?
java·数据库·后端·mysql·大厂面试
wmfglpz883 小时前
NumPy入门:高性能科学计算的基础
jvm·数据库·python
泯仲4 小时前
从零起步学习MySQL 第十二章:MySQL分页性能如何优化?
数据库·学习·mysql
IvorySQL4 小时前
直播预告|PostgreSQL 18.3 x IvorySQL 5.3:开启 AI 数据库新纪元
数据库·postgresql·开源
TDengine (老段)4 小时前
TDengine IDMP 组态面板 —— 创建组态
大数据·数据库·物联网·时序数据库·iot·tdengine·涛思数据