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)?


2 Answers 2


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.


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.

  • 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, 2012 at 17:03
  • I ended up re-installing ubuntu and mysql
    – ali haider
    Jan 14, 2013 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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