This post shows the SQL query for dropping a table with MySQL and also some screenshots showing how ot drop a table using phpMyAdmin.
SQL Query
If the table to be dropped is called "test", run the following query to delete the table. This is irrecoverable and there is no prompting to see if you really do want to drop the table.
Using phpMyAdmin
If you have phpMyAdmin installed you can easily drop a table. It pays to be very careful when dropping a table with phpMyAdmin as it is trivially easy to drop the entire database by mistake. I have personally done this a couple of times myself.
Once you are looking at the table itself in phpMyAdmin the tabbed navigation will show a "Drop" entry in red on the far right. I've circled this in red in the example screenshot below.
Note the green arrow; this highlights what you need to look out for before clicking the "Drop" link. If a table name is listed then it's a table that will be dropped.
If there's no table name specified, as shown in the next screenshot below, then clicking "Drop" will drop the entire database. So be very careful.
After clicking "Drop" a Javascript prompt will pop up as shown below to ensure you really do want to delete the table.
Click "OK" and the table will be dropped.
0 comments:
Post a Comment