TL; DR:
Run this as root and everything will be installed:
rm $(grep socket /etc/my.cnf | cut -d= -f2) && service mysqld start
Longer version:
You can find the location of the MySQL socket file by manually sticking it out in /etc/my.conf or simply using
grep socket /etc/my.cnf | cut -d= -f2
It will /var/lib/mysql/mysql.sock be /var/lib/mysql/mysql.sock . Then (as root, of course, or with sudo preended) delete this file:
rm /var/lib/mysql/mysql.sock
Then run the MySQL daemon:
service mysqld start
Removing mysqld will not solve the problem at all. The problem is that CentOS and RedHat do not clear the sock file after a crash, so you need to do it yourself. Avoiding shutting down your system (of course) is also recommended, but sometimes you cannot avoid it, so this procedure will solve the problem.
iconoclast Jan 09 '14 at 17:16 2014-01-09 17:16
source share