Solved

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

Posted on 2011-03-14
5
445 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
5 Comments
 
LVL 5

Expert Comment

by:mayankagarwal
Comment Utility
0
 
LVL 16

Expert Comment

by:santoshmotwani
Comment Utility
0
 
LVL 12

Accepted Solution

by:
upanwar earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Very similar to my previous related post,,,
Thanks
 anyways
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now