When I try to log into mysql with the command mysql -u root -p , i enter the password then it gives me the error:

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

I really don't know why it's trying to use '/usr/sbin/mysqld/mysqld.sock' because in the /etc/mysql/my.cnf i have it set to '/usr/sbin/mysqld/mysqld.sock' because that's where i got told it was when i ran whereis mysqld.sock .

Something you might want to know is that when I cd to /usr/sbin/mysqld I get a directory now found error even though it shows up when i type ls, i tried to see if it's a file by trying to open it in vim but that gave the file not found error aswell.

I am running Ubuntu Server 10.04.1.

Edited by tomtetlaw: n/a

7 Years
Discussion Span
Last Post by richieking

Okay, so now when I type mysql into the terminal, it gives the same error as before, but now it tried to use the directory I wanted to use :s


Don't worry, I changed the socket path to the default path again, and it works this time, I really have no idea why.


upgrading Ubuntu 10.04 server to 10.04.1 server randomly touches mysql socket.

There has been issues on this and proftp, and email clients. some random shows!!


This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.