CAPTCHA
Image CAPTCHA
Enter the characters shown in the image.
This question is for testing whether or not you are human.
  • Create new account
  • Reset your password

User account menu

Home
The Hyperlogos
Read Everything

Main navigation

  • Home
  • My Resumé
  • blog
  • Howtos
  • Pages
  • Contact
  • Search

How To Drop All Tables From A MySQL Database

Breadcrumb

  • Home
  • How To Drop All Tables From A MySQL Database

If you are doing much testing of content management systems, you end up needing to clear your database. If you don't want to set permissions up repeatedly, you end up wanting some way to clear all the tables from a database so you can set it up again. I found a way to do this (by googling of course, because I am lazy and do not want to think) that does not require dropping and recreating the database with its attendant permissions.

The credit has to go to "JJ". I found the answer in a MySQL list archive entry from January 2002:

Read up on mysqldump. For 3.23, something like the following should do the trick:

mysqldump databasename --add-drop-table --no-data > your_output_file.sql

And then import it:

mysql databasename < your_output_file.sql

I hope you find this as useful as I have.

computer
database
howto
MySQL
  • Log in or register to post comments

Footer menu

  • Contact
Powered by Drupal

Copyright © 2025 Martin Espinoza - All rights reserved