MySQL Drop Database

  • DROP DATABASE drops all tables in the database and deletes the database.
  • To use DROP DATABASE, user need the DROP privilege on the database.
  • DROP SCHEMA is a synonym for DROP DATABASE.

MySQL Drop Database Syntax:

DROP {DATABASE | SCHEMA} [IF EXISTS] db_name

Example: Drop database company

drop database company

DROP Database command removes following files from the db.opt file, if it exists.
.BAK .DAT .HSH .MRG
.MYD .MYI .TRG .TRN
.cfg .db .frm .ibd
.ndb .par