Symptoms
After restoring MySQL databases from InnoDB corruption, the below errors appear on the websites:
Critical Error
Could not connect to the database.
Description
When MySQL data corruption has occurred, it may be necessary to restore the databases or even repair cPanel accounts. When the databases are restored without reloading CageFS, it will cause a connection error because the user cannot connect to the MySQL socket file.
For example:
26361 23:36:05 connect(3, {sa_family=AF_UNIX,
sun_path="/var/lib/mysql/mysql.sock"}, 27) =
-1 ENOENT (No such file or directory) <0.000
Workaround
Reload the CageFS for the affected account(s):
cagefsctl --disable cpanelusername
cagefsctl --enable cpanelusername
Note: Replace "cpanelusername" with the affected account.
If multiple accounts are having issues it may be necessary to remount and force-update.
cagefsctl -M
cagefsctl --force-update