Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2005-05-12
Medium Priority
Last Modified: 2008-02-01
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.
Question by:g00r00
  • 3
  • 2
LVL 29

Expert Comment

ID: 13990577
Are U trying to connect to MySQL thru phpMyAdmin?
What happens if U remove this socket thing?

Author Comment

ID: 14004801
No, I am not using phpMyAdmin

LVL 29

Expert Comment

ID: 14006092
I suggest you nstall phpMyAdmin (PMA) and launch it.

1 - phpMyadmin resides at http://www.phpmyadmin.net
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 www.easyphp.org
It will replace/ install Appache, PHP, MySQL and phpmyadmin each fitted tyo alll others
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.


Author Comment

ID: 14047045
Cant connect to mysql trhu PMA as well
LVL 29

Expert Comment

ID: 14049443
what is PMA's error message?
Depending on the text, the solution might be very close...
LVL 10

Accepted Solution

idmisk earned 200 total points
ID: 14052746
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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month20 days, 16 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question