请前往 模块插件 激活 UI Manage 然后刷新
Global Clouddy

Account Center

Support

  1. Portal Home
  2. Knowledgebase
  3. Backup
  4. How To Drop a Database on MySQL
Login
Knowledgebase

How To Drop a Database on MySQL

MySQL is a Relational Database Management System that is known for being very easy to use, nice interface, and also fast. In this article, we will take a look at such database management techniques as deleting a database in MySQL. To get started with MySQL, open a terminal. First, check your MySQL version with the following command:

 

mysql - V

Check for the latest up-to-date database version. If it is, then proceed to the step of checking the status of the system mysql.service. To do this, run the following command:

 

sudo systemctl status mysql

If the service is not active, start the service

 

sudo systemctl start mysql

After starting the service, connect to the MySQL client or log into the MySQL shell as the root user. If you do not have access to the root user account, replace “root” with your username

 

sudo mysql -u root -p

After logging into MySQL, list the databases with SHOW DATABASES command:

 

SHOWDATABASES;

After you have a list of databases, then you need to select the database in which you want to delete. If you want to drop an existing database, you can run a simple DROP DATABASE command along with the database name like this:

 

DROPDATABASE your_database_name;

After deleting the database, you need to list the databases again, for this use the SHOW DATABASES command

 

SHOWDATABASES;

Now it is possible to notice that the remote database no longer exists in MySQL.

  • 533 Users Found This Useful
Was this answer helpful?

Related Articles

How To Backup, Restore or Transfer MySQL/MariaDB Databases on Ubuntu

Today, Backup is a significant procedure and a very important part of working with databases....

How To Make Backup And Restore PostgreSQL Databases on Ubuntu 18.04

PostgreSQL is a open source database management system that can be used to store information...

How to back up MySQL databases

MySQL is the most popular database software in the world. It's important to make sure you have a...