User account menu

Home
The Hyperlogos
Read Everything

Main navigation

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

Error message

Warning: Undefined array key "comments" in Drupal\solo\Hook\SoloThemePreprocessHooks::preprocessFieldComment() (line 938 of themes/contrib/solo/src/Hook/SoloThemePreprocessHooks.php).

How To Drop All Tables From A MySQL Database

  • Add
  • 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

    How To Drop All Tables From A MySQL Database

    • Log in or register to post comments
    Powered by Drupal

    Copyright © 2026 Martin Espinoza - All rights reserved