Mysql Drop All Tables
You can empty the content of a MySQL database via phpMyAdmin or SSH. We would highly recommend you to create a backup of your database (phpMyAdmin or SSH) prior making any changes to your databases.
Jul 9, 2014 - I'm doing some research in owncloud installation and every time i want to clear the database tables so that, i can go forward. Every time i used. If the table is partitioned, the statement removes the table definition, all its partitions, all data stored in those partitions, and all partition definitions associated with the dropped table. Dropping a table also drops any triggers for the table. DROP TABLE causes an implicit commit, except when used with the TEMPORARY keyword.
Using phpMyAdmin
This is by far the easiest way to empty a MySQL database.
Once in phpMyAdmin, select the database you wish to empty.
A list with all the database's tables will appear. Click Check All to select all tables.
Click the box With selected: and choose Drop. This will execute the DROP TABLE SQL query on all tables and once you confirm that you wish to proceed the database will be emptied.
Using SSH
Dropping the content of a database via SSH is very useful when you are dealing with large databases. In order to use the steps below you must have the drop and create database privilege (otherwise you will drop database but not able to create it again).
SiteGround customers can check this tutorial on how to connect to SSH to their hosting accounts.
Access MySQL with your database MySQL user by running the following command over SSH:
mysql -uUSERNAME -p
Make sure that you will replace USERNAME with your MySQL user and place it's password when prompted.
After that execute the following DROP and CREATE commands:
mysql> DROP database DATABASE_NAME;
mysql> CREATE database DATABASE_NAME;
Mysql Drop All Tables In A Database
Where DATABASE_NAME is the name of your database.
cPanel is easy to work with when you have the right host to support you. If you need a reliable partner to help you manage your website with cPanel, check out our cPanel hosting services!