mysqldatabasemysql-error-1049

Mysql database refuses to be deleted


One of my mysql database got corrupted, but we recovered it, and now there is a "account_%" database in our cpanel. We tried to delete it, but it continues to stay. When we try to delete it from Cpanels Mysql page, it shows it as deleted, but still continues to display it in the database list on cpanel. It does not show in the PhpMyAdmin.

The issue arises when we run backups, it stops them and we get the following error because of it -

Determining mysql dbs...DBD::mysql::st execute failed: Unknown database 'account_%' at /usr/local/cpanel/Cpanel/Mysql.pm line 1475.
DBD::mysql::st execute failed: Unknown database 'account_%' at /usr/local/cpanel/Cpanel/Mysql.pm line 1475.

account_%: mysqldump: Got error: 1049: Unknown database 'account_%' when selecting the database

/usr/bin/mysqlcheck: Got error: 1049: Unknown database 'account_%' when selecting the database

warn [pkgacct] account_%: mysqldump failed -- database may be corrupt
 (796 bytes) warn [pkgacct] Failed to dump database account_%

 ERROR: Failed to dump one or more databases

Any ideas how i can solve this situation, I have access to root ssh.


Solution

  • I contacted Cpanel support, and they were able to solve this in a matter of minutes. I'm not sure how they did it, but this is the reply they gave me

    I found that the file /var/cpanel/databases/accountname.yaml had this line:

    accountname_%: myip

    I've gone ahead and removed it, then ran /scripts/update_db_cache

    I'm running pkgacct on the accountname account, and it appears that this has resolved the issue: