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.
- Log in to your cPanel account.
- Scroll to the Databases section and click MySQL Databases.
- Scroll to the Current Databases section.
- Find the database you want to delete.
- Click Delete next to the database name.
- A confirmation prompt will appear. Click Delete Database to confirm.
Deleting a MySQL User
- In the MySQL Databases page, scroll to the Current Users section.
- Find the user you want to delete.
- Click Delete next to the username.
- 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:
- In the MySQL Databases page, scroll to Privileges (or Add User to Database depending on your cPanel theme).
- Find the user-database pair you want to remove.
- 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.