0

I have tried all the solutions to access mysql that are described before in stackoverflow. When I type mysql and the terminal asks for password,when I type password and press enter it says ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Any idea,this problem making me crazy.

Thanks in advance.

  • This one works http://stackoverflow.com/questions/7843731/cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock-2 –  Jun 01 '12 at 18:42

1 Answers1

0

Make sure you're starting the mysql server first. The command is sudo mysqld_safe. Also try looking at my.cnf (likely in /etc/) and search for "socket". You may need to change the socket location to /tmp/mysql.sock.

octern
  • 4,825
  • 21
  • 38