Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got this error message when I start mysql.

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

I just installed installed apache2 and mysql. Whenever I type mysql and hit enter I get above message. I'm on CentOS 6.

When I run whereis mysql I get:

/usr/bin/mysql 
/usr/lib64/mysql
/usr/share/mysql
/usr/share/man/man1/mysql.1.gz

And when I restart the service mysqld restart I get an "unrecognized service" error.

share|improve this question
    
Hello sankae, welcome to SU. This question is without enough detail to be able to help. Please edit and describe more about what you have done and what errors or issues you are facing. –  Paul Dec 20 '12 at 10:57
    
What OS are you on and what version of mysql and apache2 have you got installed? We resolved a similar issue by updating all packages. –  xylar Dec 20 '12 at 11:08
    
check if mysql is not running already or if port 3306 is not taken. use ps aux | grep mysql and netstat -patn to view those details –  mnmnc Dec 20 '12 at 11:09
    
to start mysql you shouldn't just type mysql start or mysql nor mysqld. Please use service mysql start to start the service. –  mnmnc Dec 20 '12 at 11:11
    
what happens when you type in whereis mysql which mysql ls /usr/sbin/ | grep mysql ? Have you tried restarting the server after mysql installation? –  mnmnc Dec 20 '12 at 11:20

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.