猿问

连接Mysql 报错ERROR 2002 (HY000)

1.Mysql 已经装好了,DB driver 也已经安装成功,在尝试连接数据库时候失败

ERROR 2002 (HY000)Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

已经尝试:

mysql start

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

mysql -uroot

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

mysql -h localhost

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

mysql -h 127.0.0.1

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)
然后去temp文件夹下面根本没有目标文件

/tmp/mysql.sock

使用查找命令:

find / -name mysql.sock

都是:

Permission denied

网上找了好多都失败~求助,谢谢


繁星点点滴滴
浏览 1747回答 1
1回答

繁花不似锦

vi /etc/mysql.cnf看下 [mysqld] 和 [mysql] 标签下 socket 配置的路径是否一致修改后重启mysql
随时随地看视频慕课网APP

相关分类

MySQL
我要回答