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, a connection error will occur 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
Remount CageFS for the affected account(s):
cagefsctl -m cpanelusername
Note: Replace "cpanelusername" with the affected account.
If many accounts are affected, you can instead remount CageFS for all accounts:
cagefsctl -M