Knowledgebase article

How to delete a MySQL database in cPanel

Sometimes a romance runs its course: an old test site, a plugin you removed, a database nobody uses anymore. Deleting it frees space and keeps your account tidy. But be warned: a deleted database cannot be brought back unless you have a backup.

Step 1: Take a backup first (strongly recommended)

  1. In cPanel, go to Files > Backup.
  2. Under Download a Database Backup, click the database name.
  3. Save the .sql.gz file on your computer.

Step 2: Make sure nothing is using it

Check that no website still depends on this database. For WordPress, open wp-config.php in File Manager and look at DB_NAME. If it matches, that site will break once the database is gone.

Step 3: Delete the database

  1. Go to Databases > Manage My Databases.
  2. Scroll to Current Databases.
  3. Find your database and click Delete under Actions.
  4. cPanel asks: "Are you sure you wish to permanently remove the database…?"
  5. Click Delete Database.

You'll see "Deleted the database …". That's it.

Step 4: Remove the leftover user (optional)

Deleting a database doesn't delete its user. If that user isn't needed anymore:

  1. On the same page, scroll to Database Users > Current Users.
  2. Click Delete next to the user, then confirm with Delete User.

Changed your mind too late?

Romeo keeps regular account backups. Open a ticket as soon as possible, tell us the database name and roughly when it was deleted, and we'll see whether it can be restored. Alternatively, look under Files > File and Directory Restoration in cPanel.

Was this answer helpful?

Related articles

Still stuck? Romeo's got you.
Our support team replies around the clock, real humans who know your server.