faqts : Computers : Databases : MySQL : Tips and Tricks

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 26 people (62%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

how do I Delete all data in a database while keeping structure in tackt (i don't want to recreate fr

May 17th, 2002 16:22
Techek, iDiC =),


If we assume you have commandline-access to MySQL I suggest you use 
these commands :
mysql> use <database_name>
mysql> show tables
For every table listed, use :
mysql> delete from <table_name>
That's it. I hope you get the idea - and be sure to USE the correct 
database for God's sake!