Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

user3344382 picture user3344382 · Mar 16, 2014 · Viewed 242k times · Source

I have installed MySQL server and trying to connect to it, but getting the error:

    Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I have checked my /tmp directory and there is no mysql.sock. I can't find mysql.sock anywhere. I read that it might be in

    /var/lib/mysql/mysql.sock

But I checked there as well and there is even no mysql directory, only some postfix thing inside /lib. Could anyone help me with this problem?

Answer

Casey Robinson picture Casey Robinson · Aug 26, 2014

Try to start the MySQL server:

mysql.server start