I have encountered problems with a mysql installation on CentOS 7. All the data is backed up, so I just want to completely erase every remnant of mysql on the machine and then do a clean install. My attempts have not yet succeeded. Can someone show me how to do the clean re-install?

Here is what I tried so far:

1.) When systemctl status mysqld reported mysqld was NOT installed, I tried yum remove mysql, but it told me there was nothing to install because mysql was already installed.

2.) I then tried rpm -qa | grep mysql and rpm -qa | grep mysqld before typing rm -e $packagename for each of the results

3.) I then followed the instructions in this tutorial, but when I got to systemctl start mysqld, the terminal "locked up" in the sense of just giving a flashing cursor on a new line that did not have a command prompt or any way to enter text. Note that I typed systemctl start mysqld instead of service mysqld start because this is CentOS 7 and not CentOS 6.

Note I also did gedit /etc/sysconfig/selinux and set SELINUX=disabled. Now the systemctl start mysqld just results in a quick failure. I want to do a completely clean install and start from scratch.

  • Does this question that I also answered help? In fact it was you who I answered it for :) – eyoung100 Dec 16 '14 at 19:15
  • @eyoung100 I took all those steps again just now. After mysql_secure_install, it asked for the current root password. I tried just hitting return. I also tried the root password on the old installation, but each time I got the following error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2). I have been dealing with such a mysql.sock error for a whole day now. I want to do the clean install to start from scratch so I do not see this error again. – CodeMed Dec 16 '14 at 19:33
  • I think the problem is deeper this time. – CodeMed Dec 16 '14 at 20:04
  • Try sudo systemctl stop mysqld && sudo rm -v /var/lib/mysql.sock then Follow the instructions to reset the root MySQL password, then restart mysqld You can't modify, remove, or update a service while it's running. – eyoung100 Dec 16 '14 at 20:38
  • rm -v /var/lib/mysql.sock gives rm: cannot remove ‘/var/lib/mysql.sock’: No such file or directory – CodeMed Dec 16 '14 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.