I just upgraded my MySQL server on Debian. However now when I start the server and try connect to it I get the error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
How can I fix this?
I know this question is five months old, but since I've run into the same problem on three different upgrades, I thought I'd post my solution anyway.
In my case, this seems to be due to a bug in the Debian update scripts (so the problem might crop up in Ubuntu as well). Somehow, some of the binary log files wind up with the wrong ownership after the upgrade process is complete. This prevents the server from gaining write access to its own logs, so it fails to start.
On Debian (at least on our servers) these files all live in
I hope this saves someone some time.
MySQL most likely failed to start. Try running
To expand on Shane's comment, check the MySQL log for reasons for it failing to start. The default location is
Try the following
Then start mysql...