Removing database contents is a destructive operation, so first decide whether you need to delete the entire database or only its tables. The two procedures below have different outcomes and should not be treated as interchangeable ways to empty rows.
Export a verified backup and confirm the exact database before proceeding. These operations remove data and can break any website that uses it. Neither method simply clears rows while retaining all table structures.
Remove the entire database through SSH
Use this method only when the database itself is no longer required. You need SSH access and an authorised database user with the required privileges.
-
Connect through SSH and open the database client. Replace
db_userwith the approved database username:mysql -u db_user -p -
Enter the password at the prompt. Do not put it in the command.
-
Check the exact database name, including any cPanel account prefix:
SHOW DATABASES; -
Only after confirming the intended target and backup, execute the following, replacing the example name:
DROP DATABASE `account_database`; -
Type
exitto leave the client. On a cPanel-managed account, use its database-management interface where possible so the control panel also tracks the change correctly.
Remove tables through phpMyAdmin
- Log in to the owning cPanel account and open phpMyAdmin.
- Select the intended database in the left panel and open Structure.
- Review the tables, then select only those you intend to remove. Check all selects every listed table.
- Choose Drop and inspect the confirmation before approving it.
Dropping tables removes their structure and data while leaving the database itself. Other objects, such as routines or events, may remain. If you want to retain the schema and remove rows instead, stop and plan that separate operation with the application’s administrator.