The most common issue for this is, puting an invalid database directory into /var/lib/mysql directory. I have been trying to tell not to put such directory ( like taking backup of DB dir ( /var/lib/mysql]#cp -pvr my_db my_db.bak, etc ) inside the MySQL data directory to people; but I can see people doing their legacy steps to take mysql backup, etc
So this is the golden rule. DO NOT PUT AN INVALID DB FOLDER INTO THE MYSQL DATA DIRECTORY.
When you experience database not listing issue, you can see the error usually by running /scripts/update_db_cache cPanel script. It will show you, what the exact error is.
So, in this case when you execute update_db_cache script…it will show the error as follows
# /scripts/update_db_cache
DBD::mysql::st execute failed: Incorrect database name ‘my_db.bak’ at /scripts/update_db_cache line 61.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /scripts/update_db_cache line 63.
So what you need to do is, move my_db.bak out from /var/lib/mysql ( MySQL data directory ) and rerun the update_db_cache script again; it should do the trick.
If you don’t see any error when you execute update_db_cache script and the issue persists; check the cpanel error log ( /usr/loca/cpanel/logs/error_log ) to find the exact error.
That is, run #tail -f /usr/loca/cpanel/logs/error_log from command line and access the cPanel.
If you still fail to isolate the issue, hire a system admin or open a ticket to the cPanel support