Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

MySQL Server does not start up on ubuntu 12. When I run the status command, the following message is displayed:

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

Any suggestions to fix this issue (and hopefully avoid this going forward) will be welcome.

Edit: The process is not running - I forgot to mention that in the post. Should I go about changing the mysql.cnf file to point to a different location for the socket location (or perhaps add a link to it)?

share|improve this question
    
please share useful suggestions - hope no one takes offense to this. –  ali haider Dec 11 '12 at 17:33
    
    
the error message may be the same but what's causing it might not be - I don't have a firewall blocking the port, disk is not out of space, my.cnf points to 127.0.0.1. Any suggestions to troubleshoot and/or fix the issue would be quite welcome. –  ali haider Dec 11 '12 at 18:32
add comment

2 Answers 2

up vote 1 down vote accepted

I ended up re-installing ubuntu and mysql in order to fix the issue. I will update the post if I come across the same issue and can come up with a better solution.

share|improve this answer
add comment

Run this command in Terminal:

sudo service mysql status

If the output is something like:

mysql stop/waiting

Then mysql server is not running on your machine. Try:

sudo service mysql start

And try to connect again.

share|improve this answer
    
I think I was not clear in the post - when I mentioned MySQL does not start, it meant that the process is not up. Startup is not working through service mysql start option. Thanks –  ali haider Dec 12 '12 at 17:03
    
I ended up re-installing ubuntu and mysql –  ali haider Jan 14 '13 at 22:13
add comment

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.