Connecting Tech Pros Worldwide Forums | Help | Site Map

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysq

Newbie
 
Join Date: Sep 2007
Posts: 1
#1: Sep 14 '07
Hi,
I just installed MySQL using "yum install mysql" and when I try to run it I get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

When I try to start the service using "service mysqld start" I get this message:
mysqld: unrecognized service

Please help.
Moises

Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,748
#2: Sep 14 '07

re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysq


Hi Moises. Welcome to TSDN!

Try doing either of those:
Expand|Select|Wrap|Line Numbers
  1. # /etc/init.d/mysql start
  2. # /etc/init.d/mysql restart
  3.  
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#3: Sep 15 '07

re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysq


Heya, Moises.

You're getting this error because the MySQL database server daemon is not running. Atli's suggestion will get you going.
Reply