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.
- Log into cPanel
- Under Databases, choose MySQL Databases
- Under the Current Databases heading, you will see the databases being used, and you can click the Delete link to obliterate one
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.
- Log into your cPanel account via the shell
- Log into MySQL by typing
mysql -u db_username -p
(substituting “db_username” with the database username) - Type in the password when prompted
- 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.