当前位置:网站首页>MySQL cannot use MySQL - U root - P to start error reporting and solve it
MySQL cannot use MySQL - U root - P to start error reporting and solve it
2022-04-21 18:59:00 【m0_ fifty-four million eight hundred and fifty thousand six hun】
Today, I installed it on the cloud some time before logging in mysql when , Use mysql -u root -p The command keeps reporting errors "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
All kinds of information , Some say will mysql Restart can solve , So direct "service mysql restart ", However, the problem is not solved when logging in .
Finally find an article , It said it was in /var/lib/mysql/mysql.sock I can't find it here mysql.sock, To /etc/my.cnf Zhongyi 
socket When configuring the pointing of /tmp/mysql.sock, To /tmp Sure enough, I found mysql.sock, So the solution is :
To /var/lib/mysql/ Under the table of contents
linux ln -s /tmp/mysql.sock .
Reuse mysql -u root -p Sign in , have already been solved
stay mysql -u root -p When unable to log in , You can also use mysql -uroot -h 127.0.0.1 -p, Sign in
The problems encountered today are recorded here , Ready for later use
版权声明
本文为[m0_ fifty-four million eight hundred and fifty thousand six hun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211852122151.html
边栏推荐
猜你喜欢
![[talkative cloud native] load balancing - the passenger flow of small restaurants has increased](/img/ba/4ccf0c2181572fed16bbc9c797d557.png)
[talkative cloud native] load balancing - the passenger flow of small restaurants has increased

In the El input search in ement, the matching input suggestions after input must have the value attribute

Which brand of wireless Bluetooth headset is good? Wireless Bluetooth headset recommendation

无线蓝牙耳机哪款比较好用?2022蓝牙耳机推荐

无线蓝牙耳机哪个品牌好?无线蓝牙耳机推荐

【王道考研3】OSI七层参考模型,TCP/IP参考模型和5层参考模型

86 r K-means, hierarchy, EM clustering introduction

DVWA-Brute Force

mysql不能使用 mysql -u root -p 启动报错解决

有什么蓝牙耳机不贵又实用?适合学生党的无线蓝牙耳机
随机推荐
预处理问题
Tiandan released the cloud native intelligent operation and maintenance product line and launched the world's first full stack observability technical standard
Apache Doris创建动态分区
数据库进阶学习:索引介绍及Btree,B+tree,hash
Pretreatment problem
The video course "vite Learning Guide - webify deployment project based on Tencent cloud" was launched "cloud + community"
Finally, wechat scanning code login is completed. It's really fragrant..
SVG系列——1,入门级操作
108. 将有序数组转换为二叉搜索树(图文并解)
Database advanced learning: index classification and creation syntax
Null和Undefined的区别
flutter xcode打包发布失败 Error.90165
I feel flustered when I eat good food
How to adjust the speed and speed of preview video in PR;
图的深度优先搜索DFS(邻接矩阵和邻接表版)
【深度之眼】情感分析——循环神经网络用于多任务学习的文本分类TextRNN
How to be a good project manager?
数据库进阶学习:存储引擎
毕业三年,一事无成,被迫回老家,一个决定改变一生。
APM 行业认知系列 - 四