How to drop multiple tables in MySQL

After an experiment with a MediaWiki Wiki on my website, I decided that I preferred to use Joomla for my site content. I needed to delete the Wiki content to free up some space.

Deleting the wiki folder was easily done through FTP.
Deleting the database tables had the potential to be time consuming.
I used this SQL to find all the relevant tables and delete the WIKI tables with SQL statements.

 

SHOW TABLES LIKE ‘wiki%’

Returned a list of tables like this….

wiki_archive

wiki_categorylinks

wiki_externallinks

wiki_hitcounter

wiki_image

wiki_imagelinks

wiki_interwiki  etc. etc.

 

Using a text editor (I like TextPad from Helios Software), create SQL to drop each table in the list.

 

drop table wiki_archive;

drop table wiki_categorylinks;

drop table wiki_externallinks;

drop table wiki_hitcounter;

drop table wiki_image;

drop table wiki_imagelinks;

drop table wiki_interwiki; etc. etc.

 

This deletes all the tables at once.

 

 

 

 

 

 

Author: Richard Bishop

http://about.me/richard_bishop