Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-14
5
Medium Priority
?
470 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
ID: 35125929
0
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 35126684
0
 
LVL 12

Accepted Solution

by:
upanwar earned 1500 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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.
Suggested Courses
Course of the Month6 days, 12 hours left to enroll

783 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