If you no longer need a database or a database user, you can remove them from your cPanel account. Deleting a database permanently removes all tables and data. Deleting a user removes their login credentials. This guide walks you through both operations.

Deleting a MySQL Database

Warning: Deleting a database permanently removes all tables and data. This action cannot be undone. Always export a backup before deleting.

  1. Log in to your cPanel account.
  2. Scroll to the Databases section and click MySQL Databases.
  3. Scroll to the Current Databases section.
  4. Find the database you want to delete.
  5. Click Delete next to the database name.
  6. A confirmation prompt will appear. Click Delete Database to confirm.

Deleting a MySQL User

  1. In the MySQL Databases page, scroll to the Current Users section.
  2. Find the user you want to delete.
  3. Click Delete next to the username.
  4. A confirmation prompt will appear. Click Delete User to confirm.

Removing a User from a Database

If you want to revoke a user access to a database without deleting the user or the database:

  1. In the MySQL Databases page, scroll to Privileges (or Add User to Database depending on your cPanel theme).
  2. Find the user-database pair you want to remove.
  3. Click Revoke (or the icon).

Important Notes

  • Deleting a database will break any website or application that relies on it (e.g., WordPress, Joomla). Make sure you have a backup before proceeding.
  • Deleting a database user will prevent any application using that user from connecting to the database.
  • It is good practice to remove unused database users to maintain security.
  • cPanel adds a prefix to database names (e.g., username_dbname) and users (e.g., username_dbuser). Delete the prefixed name, not just the base name.

Troubleshooting

"Delete" button is not visible next to a database:

  • You may not have permission to delete this database. Contact your hosting provider.
  • Some databases may be system-managed and cannot be deleted through cPanel.

Website shows "Error establishing a database connection" after deletion:

  • The website database has been deleted or the user has been removed. Restore the database from backup.

Cannot delete a user because it is still linked to databases:

  • Remove the user from all databases first (under Privileges), then delete the user.
Was this answer helpful? 0 Users Found This Useful (0 Votes)