解决 ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘

第一步:进入终端,执行 cd /usr/local/mysql
# 第二步:执行 sudo ./support-files/mysql.server start
# 完成以上两步,问题已解决
/usr/local/mysql 
$ sudo ./support-files/mysql.server start
Starting MySQL
.Logging to '/usr/local/mysql/data/bjhldeMacBook-Pro.local.err'.
. SUCCESS!

/usr/local/mysql 
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.23 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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://blog.csdn.net/lzf_hlh/article/details/114599213

在此记录一下

posted on 2022-02-07 22:09  三胖儿逆袭  阅读(271)  评论(0编辑  收藏  举报

导航