Database removed but still shows in CPanel

RCraft

Well-Known Member
Nov 7, 2010
52
0
56
Hey folks,

I have an interesting issue. Somehow a customer ended up with a database that had periods in it. They decided they wanted to remove it, and it was deleted (manually, by removing it from /var/lib/mysql), but for some reason it still shows in their CPanel account. Logging into phpmyadmin from WHM, the database isn't listed there, nor is it on the server at all at this point. Is there a cache somewhere that needs to be cleared in order to remove the database entry from their CPanel?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

Could you try issuing the following to see if this clears up the issue:

Code:
/usr/local/cpanel/bin/setupdbmap
If that does not correct it, then please go to /var/cpanel/databases location and run this command to check for the database still existing:

Code:
cd /var/cpanel/databases
cat username.yaml
Here username is the cPanel username for the account.

Next, in that same /var/cpanel/databases location, check for any existence of the database:

Code:
grep "databasename" /var/cpanel/databases/*
I did wonder if there was a reason the database was manually removed. This breaks cPanel's database mapping for databases to users to remove one from /var/lib/mysql, so was the database not removable in cPanel > MySQL databases area?

Thanks!
 

RCraft

Well-Known Member
Nov 7, 2010
52
0
56
Sorry for the delay in this. The reason the database was manually removed was because it somehow was created with a . in it. They entered the date in the database name so it was something like user_db.7.10. and CPanel would not delete the database. MySQL doesn't even support databases with a . in the name. so the whole situation was pretty bizarre.

I ended up finding the database in the user.yaml file and as soon as this was deleted from it and the changes saved the database vanished from their control panel, so that was the missing link.

Thanks.