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

1. Mysql has the error:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

$sudo /etc/init.d/mysqld status
mysql dead subsys locked

Solution:

sudo yum list mysql

find that there are two version of mysqlinstalled
mysql.i386 official package
mysql.x86_64 remi unofficial package

then I delete the official package(which is new installed)
sudo yum erase mysql.i386

chkconfig add mysqld service
* chkconfig –add mysqld
* chkconfig –level 345 mysqld on

3. sudo yum update –enablerepo remi reinstall mysql-server

4. sudo /etc/init.d/mysqld start

then the problem has been solved.

brucelee

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.