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
Solved

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

Posted on 2011-03-14
5
453 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 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

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.

Question has a verified solution.

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

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…
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 …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

829 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