ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

When i am trying to connect to mysql server I got error message:

ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

what can I do to fix it..

Thank you very much.

I need it a soon as possible.
Who is Participating?
idmiskConnect With a Mentor Commented:
this error means
1. mysql is not running, so socket is not created
2. mysql is running, but is listening only on port (default 3306)

to find it out do on shell (as root!) 'netstat -lnp | grep mysql'

example output if listening on port AND socket
tcp        0      0      *                   LISTEN      3761/mysqld
unix  2      [ ACC ]     STREAM     LISTENING     134164 3761/mysqld         /var/lib/mysql/mysql.sock

please post the output of the above command
Bernard S.CTOCommented:
Are U trying to connect to MySQL thru phpMyAdmin?
What happens if U remove this socket thing?
g00r00Author Commented:
No, I am not using phpMyAdmin

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Bernard S.CTOCommented:
I suggest you nstall phpMyAdmin (PMA) and launch it.

1 - phpMyadmin resides at
Go there and wonload the latest stable version (2.6.2.pl1).
2 - install PMA files as indicated. To summarize: they are php files which you place in ad hoc directories.
3 - You'll need to edit "config.php" to tune it with your host, dabatabse name, etc.
4 - You can the access to PMA thru your web browser. (Some trial and error will be needed for config.php)

Another "fastroute" might be to install EasyPHP, look at
It will replace/ install Appache, PHP, MySQL and phpmyadmin each fitted tyo alll others
g00r00Author Commented:
Cant connect to mysql trhu PMA as well
Bernard S.CTOCommented:
what is PMA's error message?
Depending on the text, the solution might be very close...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.