Prev | Current Page 98 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


Deleting All the Rows in a Table
To completely erase all the rows in a table (leaving its structure intact), we go to the
Database view and click on the database name in the left panel. We then click on the
trash can icon located on the same line as the table we want to empty:
We get a message confirming the TRUNCATE statement (the MySQL statement used to
quickly empty a table). For our exercise, we won't delete this precious data!
Emptying a table can also be done in Table view with the Empty link located on the
top menu:
Changing Data
[ 94 ]
Deleting data, either row-by-row or by emptying a table, is a permanent
action. No recovery is then possible except by using a backup.
Deleting All Rows in Many Tables
The screen before last shows a checkbox to the left of each table name. We can choose
some tables, then in the With selected menu, choose the Empty operation, as shown
in the following screen:
Of course, this decision must not be taken lightly!
Deleting Tables
Deleting a table erases the data and the table's structure. We can delete tables using
the Drop link in Table view:
In the Database view, we can delete a specific table by using the X-shaped icon for
that table. The same mechanism also exists for deleting more that one table (with the
drop-down menu and the Drop action).
Chapter 5
[ 95 ]
The Empty and Drop actions are marked in red to better indicate the
inherent danger of these actions on data.


Pages:
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110