首页 > 数据库 >msql报错ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld

msql报错ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld

时间:2022-11-09 12:07:55浏览次数:74  
标签:run socket sock HY000 报错 mysql mysqld

msql报错ERROR 2002 (HY000): Can

linux环境下安装msql后进入mysql,报错ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)

首先,一定要检查mysql是否在运行,

1检查端口是否打开

msql报错ERROR 2002 (HY000): Can

2检查服务是否在运行

 如果是mariadb(是mysql的一个分支)

msql报错ERROR 2002 (HY000): Can

如果是mysql

msql报错ERROR 2002 (HY000): Can

此状况是mysql在正常运行的

msql报错ERROR 2002 (HY000): Can

如果上述都正常,那么就剩下socket有问题了,可以参照下列方法:

使用“ln -s /storage/db/mysql/mysql.sock /var/lib/mysql/mysql.sock”命令。

msql报错ERROR 2002 (HY000): Can

一定要看mysql服务启动没有,我就是没启动,才报错。

标签:run,socket,sock,HY000,报错,mysql,mysqld
From: https://blog.51cto.com/u_15491284/5835783

相关文章