Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Sorry if this is the wrong place to post. I upgraded to 12.04 and mysql stopped working. I re-installed mysql server package. When I try to log on to database I get:

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

That file (mysqld.sock) doest not exist. Yet mysqld process is up and running. I see it when I go ps -ef.

Shutdown and restart mysql works fine, I just can't log on. I have my database on a directory that is not the default installation data directory. I added my path to the apparmor configuration file.

share|improve this question

reset MySQL password . you lose nothing . I am sure .

that URL can help you .

share|improve this answer
Sorry, I tried that, didn't work. When I do step 3 to change the password I get the same error. $ mysql -u root mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) $ – user126383 Jan 27 '13 at 20:00
I also tried reconfiguring with: sudo dpkg-reconfigure mysql-server-5.5 I got an error: Unable to set password for the MySQL "root" user. – user126383 Jan 27 '13 at 21:31

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.