Don't miss

Tuesday, December 11, 2012

HowTo : Cpanel not displaying active databases

In :

 
   

Once in a while Cpanel does act bad and decides to play a hide n seek game, and as seekers we have to find the hidden stuff. Going back to technical jargon, you might find one day that all your databases listed under Cpanel is missing. So if you have root access to your server, then here is a cool way how you can fix it up in a matter of seconds. Ready?

Here we go

As always run the command :
-bash-3.2# /scripts/upcp --force &&
 /scripts/checkperlmodules --force && 
/usr/local/cpanel/bin/setupdbmap --force


usually these should fix the issue without even you knowing what was causing it, but if you are curious, try running:

cat /usr/local/cpanel/logs/error_log|grep mysql|less

or
tail -f /usr/local/cpanel/logs/error_log|grep mysql
check for the recent errors you see on the page, do you see any authentication errors from root user? If yes, then try running command:
-bash-3.2# mysql


normally if you are signed in as root then you shouldn't have any trouble reaching mysql prompt from there. But if you do then you will have to try the following steps:

Login to WHM as root >> MySQL Root Password

And reset the password, once you have the new password, check back on the ssh screen and run the command:

-bash-3.2# mysql_fix_privilege_tables --verbose --password=newpassword


Once this is done, try logging on to Cpanel for the account and add a database, and check back on the listing, you should find your databases back on the list.

UPDATE : If the error persists, then please try running
-bash-3.2# /scripts/update_db_cache
-bash-3.2# vi /etc/my.cnf
and add the entry:
innodb_force_recovery = 4

and restart mysql.

References:

CPanel Docs, Cpanel Forums


Updated at: Tuesday, December 11, 2012