0%

Fedora 19 下 Mysql 报错 ERROR 2002 解决方法

使用

1
mysql -u root -p

启动Mysql报错

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

然后

1
2
3
su -
service mysqld start
mysql -u root -p

还是出现

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

发现是service 这里可能会有问题

用绝对路径启动就行了

1
/etc/init.d/mysqld start

启动Mysql

完整命令

1
2
3
su -
/etc/init.d/mysqld start
mysql -u root -p