How to Rename or Delete a MySQL Database in cPanel Print

  • 0

You can rename or delete a MySQL database from cPanel, for example to tidy up after removing an old site. Both changes affect any website that uses the database, so take a copy first.

Before you start: back up the database

Deleting a database can't be undone from cPanel. Download a copy first, either with Files › Backup (see partial backups) or by exporting it in phpMyAdmin (see import and export a database).

Rename a database

  1. Log in to cPanel and go to Databases › MySQL Databases.
  2. Under Current Databases, find the database and click Rename.
  3. Enter the new name and click Proceed. cPanel keeps your cPanel username prefix (for example example_) at the start.
  4. Update your app's settings with the new name straight away. For WordPress, change DB_NAME in wp-config.php; until you do, the site will show a database connection error.

Users linked to the database keep their access after a rename. On a large database the rename can take a little while, and the site may be unavailable until it finishes, so choose a quiet time.

Delete a database

  1. Go to Databases › MySQL Databases.
  2. Under Current Databases, find the database and click Delete.
  3. Read the warning and click Delete Database to confirm.

Deleting a database doesn't delete its database user. If nothing else uses that user, remove it under Current Users on the same page.

Good to know

  • Not sure which site uses a database? Check the app's configuration file (for WordPress, DB_NAME in wp-config.php) before deleting anything.
  • If you delete a database by mistake, our automated daily backups are kept for 7 days. Open a support ticket as soon as possible and tell us the database name. See what backups we keep.

Was this answer helpful?

« Back