Delete a mysql database on linux:
These directions are supposed for deleting a MySQL information on LINUX via the program line.
I’ll be engaging from a Liquid internet Core Managed CentOS seven server, and I’ll be logged in as root.
First we’ll login to the MySQL server from the program line with the subsequent command:
In this case, I’ve nominal the user root with the -u flag, so used the -p flag so MySQL prompts for a parole. Enter your current parole to finish the login.
If you wish to alter your root (or any other) parole within the info, then follow this tutorial on ever-changing a parole for MySQL via the statement.
You should currently be at a MySQL prompt that appears terribly kind of like this:
Delete a Database in MySQL
It only takes one simple command to delete a database in MySQL, but BEWARE; dropping a database can not be undone! The command is as follows:
If a database of the name tutorial_database does not exist, then you’ll receive this error:
To avoid seeing this error use the following command instead:
The above command will only drop the database tutorial_database if a database of that name exists.
View All MySQL Databases
To view a list of databases simply issue the following command:
Your result should be similar to this: