当前位置: 首页 > news >正文

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数据库的时候用一下命令

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>

在这里插入图片描述
完美解决!

http://www.lryc.cn/news/365225.html

相关文章:

  • 【校招】【社招】字节跳动UG营销算法工程师招聘
  • Go实战 | 使用Go-Fiber采用分层架构搭建一个简单的Web服务
  • Web自动化测试框架+PO模式分层实战(超细整理)
  • 光猫、路由器的路由模式、桥接模式、拨号上网
  • iOS--工厂设计模式
  • [Python]用Qt6和Pillow实现截图小工具
  • Podman和Docker的区别
  • Go微服务: 分布式Cap定理和Base理论
  • Mysql学习(四)——SQL通用语法之DQL
  • 【ARFoundation自学05】人脸追踪(AR Face manager)实现
  • Vulnhub-DC-2
  • VNC server ubuntu20 配置
  • c++--priority_queue和仿函数
  • Harmony os Next——关系型数据库relationalStore.RdbStore的使用
  • 快手直播限流怎么办?
  • 【MySQL】数据库入门基础
  • cannot allocate memory in static TLS block
  • Leetcode 654:最大二叉树
  • uniapp小程序src引用服务器图片时全局变量与图片路径拼接
  • 比较PWM调光和无极调光
  • 【高校科研前沿】新疆生地所陈亚宁研究员团队在GeoSus发文:在1.5°C和2°C全球升温情景下,中亚地区暴露于极端降水的人口增加
  • 使用 OKhttp3 实现 智普AI ChatGLM HTTP 调用(SSE、异步、同步)
  • 智慧校园教学模式的崛起:优化学习体验
  • ffmpeg视频编码原理和实战-(5)对编码过程进行封装并解决丢帧问题
  • halo进阶-主题插件使用
  • 资深开发推荐的IDEA 插件
  • 数学题目系列(一)|丑数|各位和|埃氏筛|欧拉筛
  • k8s学习--Secret详细解释与应用
  • 功能问题:如何防止接口重复请求?
  • 系统架构设计师【第5章】: 软件工程基础知识 (核心总结)