When various network applications use a database, from time to time it becomes necessary to completely or partially delete the tables of this database or only their contents. The most convenient way to do this is using the phpMyAdmin application, which allows you to perform the necessary operations directly in the browser using an intuitive interface.
Necessary
PhpMyAdmin access
Instructions
Step 1
Download phpMyAdmin, enter your login and password in the authorization form and select the database to be cleaned in the left frame of the interface.
Step 2
Click the "Check All" link below the list of tables in the right frame of the application interface if you want to delete absolutely all of the contents of this database.
Step 3
Select the "Delete" line in the drop-down list labeled "With marked". After that, without pressing any additional buttons, the application will compose the corresponding SQL query and ask you to confirm its execution - click "Yes". The request will be sent, the tables and their contents will be deleted, and the table of results of the SQL query will be loaded into the right frame of the interface.
Step 4
If you want to clear only the contents of all tables in this database, then after clicking on the "Check all" link, select the "Clear" command in the drop-down list. This request will also be sent immediately and you will be asked to confirm that the TRUNCATE command has been executed for each table. Click "Yes" and the SQL query will be executed and the report presented on this page.
Step 5
If you need to clear the database tables from the accumulated "garbage" (already unused service records and corrupted data), then click the "Mark those requiring optimization" link. This time, in the drop-down list, you need to select the "Optimize Table" command. Please note: the link "Mark in need of optimization" will be present in the interface only if the application can find tables that need optimization.
Step 6
You should act similarly if you need to restore damaged database tables. After selecting all tables, select the "Restore table" line in the drop-down list.