Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is NOT a duplicate of

The issue there was of insufficient disk space. No such problem here.

I have a mysql setup on a Redhat Centos 5.5 system, which was working fine until I restarted it.

The webapplication spits out:

 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

when trying to connect to it.

I'm not able to run:

 root@server [~]# /usr/bin/mysql_secure_installation
 Enter current password for root (enter for none):
 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Irrespective of what I enter (root password, earlier mysql password, or blank), it still says the same thing.


root@server [~]# cat /var/log/mysqld.log
101021 18:37:34  mysqld ended

Edit1: After doing service mysqld restart

101022 00:43:46  mysqld started
101022  0:43:46  InnoDB: Started; log sequence number 0 2820714
101022  0:43:46 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
share|improve this question
up vote 0 down vote accepted

Try restarting it to see if there are any error messages.

service mysqld restart
share|improve this answer
It started up my application, but I'm not sure if it ended my problems... The log output in Edit1 – siliconpi Oct 22 '10 at 0:45
Sounds like it's not set to run at startup then. chkconfig mysqld on – Ignacio Vazquez-Abrams Oct 22 '10 at 0:48
Precisely that! I did that, did a restart to check and voila! – siliconpi Oct 22 '10 at 11:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.