Centos – /var/lib/thesql folder is not coming up after install

centosMySQLvar

I'm having some trouble with reinstalling MySQL, since i uninstalled it. I have been unable to install it again.

yum install mysql-server
yum install mysql

But what ever I do, the folder /var/lib/mysql is not having any files in it. When I do the command

mysql

I get this message: "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
I don't know what to do, what can I do to get the folder reappearing?

Best Answer

/var/lib/mysql is populated when mysqld is first started. Installing a package with yum doesn't automatically start mysqld.

/etc/init.d/mysqld start
chkconfig mysqld on

If I'm all wrong about this and you already tried to start mysqld, post mysqld.log please.