Hi to all commandline/mysql experts,
I am having a error when typing the comman “mysql -v”
I got this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
What I am thinking is I need to update the code where /var/run/mysqld/mysqld.sock is located then point it to somewhere that is exists or alternative is to create a file mysqld.sock and place it in the directory /var/run/mysqld/.
But I don’t know where to start. :C
Any idea will be much appriciated.
Thank you.
First off:
Are you trying to connect to a MySQL server running in your local machine? Check whether it’s running with something like
$> ps -efl | grep mysql | grep -v “grep”
Is it working and still you can’t connect? Well, then you can check the socks and stuff in the file /etc/my.cnf
Are you trying to connect in a server not in your local page? Then you have to tell mysql where to (say you try to connect to a server located in 111.111.111.111:
$> mysql -h 111.111.111.111