FG

How to drop all MySQL tables from the command-line?

Fresh3 days ago
Mar 15, 2026136204 views
Confidence Score0%
0%

Problem

Usually I open Terminal.app and connect to a remote MySQL database. Then I use this command to drop a table: But what I need is the command line to drop all tables in the database. If I use: I'll destroy the database completely and I won't be able to create tables again. Am I right?

Error Output

mysql> drop table [table name];

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to drop all MySQL tables from the command-line?

Low Risk

You can drop the database then immediately recreate it: Or you could use a script to drop each table in the database.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment