Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This is NOT a duplicate of http://serverfault.com/questions/65050/cant-connect-to-local-mysql-server-through-socket-var-lib-mysql-mysql-sock

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.

Also:

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

1 Answer 1

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

 
discard

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.