Old test sites, abandoned plugins and half-finished migrations leave databases behind, and cleaning them up keeps your account tidy and frees disk space. But deleting the wrong one takes a live website offline instantly. This guide shows how to delete a MySQL database or database user in cPanel safely: how to prove nothing uses it, take a copy, and remove it without surprises.
What deleting actually does
Databases and database users are separate things in cPanel, and deleting one doesn't delete the other:
| You delete... | What happens | What stays behind |
|---|---|---|
| A database | Every table and row in it is erased immediately. | The database user(s) that had access. They now have nothing to access. |
| A database user | That login stops working everywhere it was used. | The database and all its data. |
| A user's access to one database | That user can no longer use that one database. | Both the user and the database, untouched. |
There's no recycle bin in cPanel. Once you click delete, the only way back is a backup.
Step 1: Make sure nothing is using it
This is the step that prevents outages. A database name like username_wp482 doesn't tell you which site it belongs to, so check before you delete.
Check your website's config file
- In cPanel, go to Files > File Manager.
- Open
public_htmland any subdomain or staging folders you have. - For each WordPress install, right-click
wp-config.phpand choose View. Note theDB_NAMEandDB_USERvalues. Other software keeps them in files such asconfiguration.php(Joomla),.env(Laravel) orconfig.php.
Any database or user named in a config file that's in use must stay.
Search all your files at once (faster)
If you have a lot of folders, open Advanced > Terminal and search every PHP and config file for the name:
grep -rl --include='*.php' --include='.env' 'username_wp482' ~/public_html ~/*/ 2>/dev/null
No output means no file mentions it. If a file is listed, that site still depends on the database.
Check WP Toolkit
Go to Domains > WordPress Management (WP Toolkit). Click each site and look at its database details. Staging copies have their own databases -- don't delete a staging database while the staging site still exists; remove the staging site through WP Toolkit instead.
Look inside the database
In Databases > phpMyAdmin, click the database and look at its tables. Open the options table (for WordPress, wp_options or similar) and check the siteurl row -- it tells you which site the database belonged to. On the Structure tab, a database with no tables, or tables that haven't changed in years, is a good candidate for removal.
Step 2: Download a copy first
Even if you're sure, keep a copy for a while:
- In phpMyAdmin, click the database, then the Export tab.
- Choose Custom, set Compression to gzipped, and click Export.
- Save the file on your computer with a clear name, such as
old-blog-database-2026.sql.gz.
Your account's automatic JetBackup 5 backups also include your databases, but they only go back about two weeks (the most recent 7 backups). If you realize a month later that you needed something, only your own download will have it.
Step 3: Delete the database in cPanel
- Log in to cPanel (from the client area: Services > My Services, choose your plan, then Log in to cPanel).
- Go to Databases > Manage My Databases.
- In the Current Databases table, find the database. Double-check the full name.
- Click Delete in its row.
- cPanel asks you to confirm. Read the name once more, then click Delete Database.
- Click Go Back. The database is gone from the list.
Don't delete databases from inside phpMyAdmin (the Drop option on a whole database). cPanel keeps its own list of your databases, and deleting behind its back can leave the two out of step.
Step 4: Delete the database user (optional)
If the database user was only used for the database you just deleted, remove it too so there are no unused logins on your account.
- In Manage My Databases, scroll to Current Users.
- Before you delete, check the user isn't used by another site. Scroll back up to Current Databases and look at the Privileged Users column -- if the user is still listed next to another database, it's shared. Check that site's config file before going further.
- Click Delete next to the user and confirm with Delete User.
Removing a user's access without deleting anything
Sometimes you just want to cut off access -- for example, a developer's user should no longer reach your shop database, but you want to keep both.
- In Manage My Databases, find the database in Current Databases.
- In the Privileged Users column, click the trash can icon next to the user.
- Confirm with Revoke User Privileges from Database.
The user and database both remain, but that user can no longer log in to that database. If a website was using that user, it will show a database connection error, so be sure it's the right one.
Deleting a WordPress site? Use WP Toolkit
If the database belongs to a WordPress site you're removing completely, it's often cleaner to remove the site in WP Toolkit (Domains > WordPress Management) than to delete pieces by hand. WP Toolkit removes the site's files and its database together. Make a backup first -- the WP Toolkit backup guide in the related links shows how.
Troubleshooting
My site shows "Error establishing a database connection" after a cleanup
You deleted (or revoked) something the site still needed. If you downloaded a copy, recreate a database and user with the same names as in the site's config file, add the user with ALL PRIVILEGES, and import your copy. If you didn't, restore the database and the database user from JetBackup 5 -- restoring only the database doesn't bring the user back.
I can't find the database in JetBackup to restore it
It may be older than the backups we keep (the latest 7), or newer than the last backup. Check your own downloads, and open a ticket if you think it should be there.
Disk usage didn't drop after deleting
The statistics on the cPanel home page can take a little while to update. Check again later. If the number still looks wrong the next day, open a ticket.
The Delete link does nothing or shows an error
Log out of cPanel, log back in and try again. If it still fails, open a ticket with the database name and the exact message.
Common questions
Can I undo a deletion?
Not in cPanel. Your options are importing a copy you downloaded, or restoring from JetBackup 5 if the database was in one of the recent backups.
Does deleting a database free up disk space?
Yes. Databases count toward your account's disk usage, so removing large unused ones gives that space back.
Is there a limit on how many databases I can have?
Your plan includes unlimited databases, so you don't need to delete one to make room for another. Cleaning up is about tidiness, disk space and security.
Can I rename a database instead of deleting it?
Yes. In Manage My Databases, click Rename next to the database, enter the new name and click Proceed. Behind the scenes cPanel creates a new database, copies everything across, re-links the users and removes the old one, so take a copy first -- and any site using the old name will stop working until you update its config file. Renaming is a handy "soft delete": give a database you think is unused a name like username_old_blog, wait a few weeks, and delete it if nothing complains.
There are database users I don't recognize. Can I delete them?
You may see database users you didn't create, or users left by installers. Treat them like any other: check the config files before removing them. If you're not sure what something is, open a ticket and ask before deleting.
Should I delete databases left behind by uninstalled plugins?
Most plugins store their data as tables inside your main WordPress database, not as separate databases. Removing leftover tables is a different job -- ask your developer, or export first and remove only tables you're certain about.
Related guides
- How to Create a MySQL Database and User in cPanel
- How to Import and Export a Database with phpMyAdmin
- How to Restore a MySQL Database with JetBackup 5
- How to Back Up and Restore WordPress in WP Toolkit
- Understanding cPanel Statistics: Disk Space, Bandwidth and Databases
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
