There are two ways to empty a MySQL database: via phpMyAdmin and SSH.
NOTE 1: By default, SSH access is disabled on all our shared servers. If you need SSH to be enabled, contact our Hosting support via Live Chat or submit a ticket to the Hosting department.
NOTE 2: We recommend making a backup of your database before proceeding with any changes.
Using phpMyAdmin
To empty a database follow these steps:
1. Go to cPanel >> Databases section >> phpMyAdmin menu.
You can quickly access
phpMyAdmin using
cPanel Shortcuts in the Namecheap account.
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/php_my_admin.png)
2. Select the database you wish to empty. A list with all the database tables will appear on the left (you may have just one database if only one website is hosted):
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_1.1.png)
3. Tick Check All to select all tables and choose the Drop option from the With selected drop-down list:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_1.png)
4. This will execute the DROP TABLE SQL query to empty all the tables at once. On the next step, confirm you wish to proceed by clicking the Yes button:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_2.png)
Using SSH
When you have a large database, it can be quicker to drop the database via SSH:
1. First, check if the database user has the privileges to Drop and Create. Go to cPanel > Databases section > MySQL Databases menu:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/mysql_databases.png)
2. Find the database you wish to drop and click the assigned username:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_3.png)
3. You will see what privileges this user has. Make sure Drop and Create options are selected.
If these options are not ticked, select them and click Make Changes:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_4.png)
3. Connect to the hosting account via SSH. You can find the detailed instructions here.
4. Once connected, run the following command:
mysql -uUsername -pPassword
where:
Username - the MySQL user assigned to the database you are working with.
Password - password for the MySQL user.
5. You should receive the following output:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_5.png)
6. To drop the database run this command:
drop database database_name
where database_name is the name of your database:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/emty_db_6.png)
That's it!