Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've created a virtual machine and am installing things from scratch. Definitely not a sys admin so I'm running into some trouble. I've installed these packages and then restarted httpd

yum -y install mysql
yum -y install php-mysql
yum -y install mysql-devel
service httpd restart

The httpd restart is successful yet I am still getting this error:

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

I looked at /etc/my.cnf and indeed, socket is pointing to that path.

But the /var/lib/mysql folder does not even exist, nor do some files which seem crucial such as /etc/init.d/mysql. Am I missing some other important MySQL yum package? Why would some files (such as my.cnf) exist while others don't?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

It's likely that you need to install the mysql-server package.

yum install mysql-server

You can search for packages by name with some of the following yum commands:

# list all packages starting with "mysql"
yum list mysql\*

# search package names/summaries/descriptions for "mysql"
yum search mysql

The packages which you did install likely provided only the client and client libraries, which you could use to connect to a mysql server located on another host.

share|improve this answer
1  
That did it, thanks for explaining the difference between client/server and also showing me how to search for mysql-related packages! –  andrewtweber May 14 '12 at 13:27
    
You're welcome! –  jeff May 14 '12 at 16:16

Your Answer

 
discard

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.