What to do after I deleted /var/lib/mysql on a cpanel server | Web Hosting | Domain Registration | Wordpress Hosting | SSL Certificates

What to do after I deleted /var/lib/mysql on a cpanel server

Restoring /var/lib/mysql can be done by putting back a backup. If you did not have a backup, you've lost your database. The only thing that can be done is reinstalling the MySQL server:

Re Installation of MYSQL On Cpanel Servers:



Run the following command to find the SQL rpms that were installed on your server:

rpm -qa | grep -i sql

2) Remove the necessary MySQL rpms uisng yum.

Example: yum remove MySQL55-shared-5.5.30-3.cp1136.x86_64 MySQL55-client-5.5.30-3.cp1136.x86_64 MySQL55-devel-5.5.30-3.cp1136.x86_64 MySQL55-test-5.5.30-3.cp1136.x86_64

3) Then delete the MySQL PID file(s) using this command:

rm -f /var/lib/mysql/*.pid

4) Finally run following script to install the cPanel compatible MySQL rpms:

/scripts/check_cpanel_rpms --fix


SHARE