Solved

how to solve "Can't connect to local MySQL server through socket"

Posted on 2011-03-14
5
458 Views
Last Modified: 2012-05-11
I tried to start the mysqld service in linux and I got the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

how to resolve this issue
0
Comment
Question by:pvinodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Expert Comment

by:mayankagarwal
ID: 35125929
0
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 35126684
0
 
LVL 12

Accepted Solution

by:
upanwar earned 500 total points
ID: 35127179
Check the mysql service is running ot not.

# ps -ef | grep -i mysql

or

# /etc/init.d/mysqld status

If the service is not running then do

# /etc/init.d/mysqld start

0
 
LVL 4

Expert Comment

by:undersky
ID: 35158536
first try to restart mysql service:

# /etc/init.d/mysql restart
or
service mysql restart

then do dmesg, and
cat /var/log/mysql/error.log

and send here.

problem is 1. Mysql not running
2. MySQL can't run (broken, or wrong config)
3. service can't access to MySQL socket.
Service don't have permission to open .sock (if u change rights manualy)
0
 

Author Closing Comment

by:pvinodp
ID: 35163230
Very similar to my previous related post,,,
Thanks
 anyways
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
UM7 Stop Sending packets with GPS Sensor 1 44
IMAP copying tool 14 76
Edit smb.conf-file in Samba om a ReadyNAS 3 75
SQL Function 4 38
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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