I have been doing some work with MySQL recently and needed to use InnoDB. I checked to see if it was installed and switched on using: mysqladmin variables | grep have_innodb. It said no so i went into /etc/mysql/my.cnf and commented out –skip-innodb

After i restarted and tried to log in I am getting the following issue:

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

migrated from stackoverflow.com Aug 21 '12 at 8:47

This question came from our site for professional and enthusiast programmers.

  • When you say you tried to log in, how are you doing it? Command-line mysql or via another application? – BryanH Aug 20 '12 at 19:06
  • Is your client and server expecting the same socket? (socket option in the configuration files) – pkhamre Aug 21 '12 at 8:48
  • did you check the mysql logs for errors while starting? – Goez Aug 21 '12 at 8:48

The error that you are seeing is most likely caused by the mysqld service not running. You can test this with

service mysqld status
mysql start/running, process 13632

or more likely in your case

service mysqld status
mysql stop/waiting

There are many reasons why your mysql might not be running, you'll most likely find more information about why in the error log /var/log/mysql/error.log

Your Answer

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