Summary
When JetBackup attempts to back up a cPanel account, it may fail with the following error:
mysqldump: Got error: 1049: Unknown database when selecting the database
This occurs when a database has been deleted directly from MySQL but remains registered in cPanel's internal ownership records, causing JetBackup to attempt a backup of a database that no longer exists.
Root Cause
JetBackup does not query MySQL directly to discover which databases belong to an account before each backup. Instead, it relies on the cPanel API to determine which databases should be included.
This means that if a database is deleted from MySQL by any method other than the two supported cPanel channels, cPanel's user-database map will still list that database as belonging to the account. JetBackup will then attempt to back it up via mysqldump, which returns the 1049: Unknown database error because the database no longer exists in MySQL.
How to Reproduce / Verify
Use the following whmapi1 command to confirm that cPanel still reports the deleted database as associated with the account: (Replace <cpanel_username> with the cPanel account)
whmapi1 list_databases \
api.filter.enable=1 \
api.filter.a.field=engine \
api.filter.a.arg0=mysql \
api.filter.a.type=eq \
api.filter.b.field=cpuser \
api.filter.b.arg0=<cpanel_username> \
api.filter.b.type=eq
If the missing database appears in the output, cPanel's ownership records are out of sync with MySQL — confirming this is the root cause.
Resolution
To properly remove a database so that both MySQL and cPanel's user-database map are updated, use one of these two supported methods only:
Option 1 — cPanel "Manage Databases" GUI
- Log in to the cPanel account.
- Navigate to Databases → MySQL Databases
- Use the Delete option next to the database under the Manage Databases section.
- Re-run the backup job and verify the error is resolved.
Option 2 — UAPI via Command Line
Run the following command as root (replace user1234 and wp_userdb123 with the actual username and database name):
uapi --user=user1234 Mysql delete_database database=wp_userdb123
Then, Re-run the backup job and verify the error is resolved.
Both methods remove the database from MySQL and update cPanel's internal ownership map, preventing JetBackup from attempting to back up a non-existent database.

