欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ERROR 2002 (HY000): Can't connect to local MySQL server thr_MySQL

程序员文章站 2022-06-02 14:20:06
...
bitsCN.com

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'解决

用XAMPP装装好mysql之后,mysql -uroot 连不上,报这个错误:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

在mysql的配置文件里,/opt/lampp/etc/my.cnf, 发现了这样的配置:

[java]

# The following options will be passed to all MySQL clients

[client]

#password = your_password

port = 3306

socket = /opt/lampp/var/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

[mysqld]

user = nobody

port = 3306

socket = /opt/lampp/var/mysql/mysql.sock