How to Delete Database in mysql through Linux Shell

There are 2 methods in order to delete the database in mysql through Linux Shell.

Method 1:

Delete through mysqladmin Command

You can delete the database without logging in mysql database;

# mysqladmin -u[username] -p[password] drop [database]

Method 2:

Step 1: Login in mysql Database

First we’ll login to the MySQL server from the command line with the following command:

# mysql -u root -p

Step 2: Delete Database

mysql> DROP DATABASE test_database;
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *