
which will drop the database itself, and all tables in it.

However, if you want to drop all tables in the database, but you also want to
keep the database itself and any other non-table objects in it, then you would
need to execute DROP TABLE to drop each individual table. You can construct
these DROP TABLE commands by querying the TABLES table in the
information_schema database. For example:

SELECT CONCAT('DROP TABLE IF EXISTS `', TABLE_SCHEMA, '`.`', TABLE_NAME, '`;')
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'mydb';

Atomic DROP TABLE
-----------------

MariaDB starting with 10.6.1
----------------------------
From MariaDB 10.6, DROP TABLE for a single table is atomic (MDEV-25180) for
most engines, including InnoDB, MyRocks, MyISAM and Aria.

This means that if there is a crash (server down or power outage) during DROP
TABLE, all tables that have been processed so far will be completely dropped,
including related trigger files and status entries, and the binary log will
include a DROP TABLE statement for the dropped tables. Tables for which the
drop had not started will be left intact.

In older MariaDB versions, there was a small chance that, during a server
crash happening in the middle of DROP TABLE, some storage engines that were
using multiple storage files, like MyISAM, could have only a part of its
internal files dropped.

In MariaDB 10.5, DROP TABLE was extended to be able to delete a table that was
only partly dropped (MDEV-11412) as explained above. Atomic DROP TABLE is the
final piece to make DROP TABLE fully reliable.

Dropping multiple tables is crash-safe.

See Atomic DDL for more information.

Examples
--------

DROP TABLE Employees, Customers;

Notes
-----

Beware that DROP TABLE can drop both tables and sequences. This is mainly done
to allow old tools like mysqldump to work with sequences.

URL: https://mariadb.com/kb/en/drop-table/