Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-14
5
Medium Priority
?
467 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 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
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.
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…

722 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