How to Delete a Database with MariaDB

In this article, we are going to be deleted the databases with MariaDB. If you were curious about creating databases, you will want to check out the article on how to create databases with MariaDB.

Using MariaDB inside your VPS/Dedicated server involved replacing MySQL as your database storage engine.

How to Delete a MariaDB Database in cPanel

You will have a few options for deleting your database. In the first part of this tutorial we are going to be deleting the database in the familiar, graphical cPanel interface.

  1. Log into cPanel
  2. Under Databases, choose MySQL Databases
    Select MySQL Databases
  3. Under the Current Databases heading, you will see the databases being used, and you can click the Delete link to obliterate one
    Click the Delete Link

Be aware that once you have deleted a database, it is not recoverable unless you have saved a backup.

How to “Drop” Databases on The Command Line

Once you are working in “the shell,” or, on the command line, you can log into MySQL to manage databases. You may refer to deleting a database here as “dropping” a database because that is the command we will use.

  1. Log into your cPanel account via the shell
  2. Log into MySQL by typing mysql -u db_username -p (substituting “db_username” with the database username)
  3. Type in the password when prompted
  4. Once logged in, you will see the mysql command prompt, at which point you may type in the command to create the database:
     DROP DATABASE db_name;

The command we just used with delete or “drop” a database named “db_name”, but you will want to substitute that generic name with something relevant to your project.

CM
Christopher Maiorana Content Marketing Writer

Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.

More Articles by Christopher

Was this article helpful? Let us know!