Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I installed MySQL using yum install mysql on an Amazon EC2 Micro instance using the Basic 64-bit Amazon Linux AMI 2010.11.1 Beta AMI. I try to connect to MySQL using the command mysql but I get the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I can't understand why this is happening. I seem to be the same as this question here. What can I do?

share|improve this question
up vote 2 down vote accepted

The server may not be installed, try

yum install mysql-server

it will start as part of the installation process. Use

chkconfig mysqld on

to have the server run after a reboot.

share|improve this answer
Ha, didn't install the mysql-server part. Good catch, thanks a bunch. – Chiggins Feb 21 '11 at 1:33
No problem, easy mistake to make :) – Andy Feb 21 '11 at 12:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.