Home > Database > Mysql Tutorial > mysql tutorial: MySQL delete database

mysql tutorial: MySQL delete database

黄舟
Release: 2016-12-16 15:57:23
Original
1392 people have browsed it

Delete a database
To delete a database, you can use the DROP DATABASE statement. The format of the statement is as follows:
DROP database db_name;
The operation of deleting a database should be used with caution. Once this operation is performed, all structures and data of the database will be deleted. Deleted, there is no possibility of recovery unless the database is backed up.
Example:
Delete the database named shili through the drop database statement. The code is as follows:
mysql> drop database shili ;
Query OK, 0 rows affected (0.00 sec)
mysql> show databases ;
+------ ---------------+
| Database |
+--------------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
After deleting the database, there will be only two databases in the MySQL server.

The above is the mysql tutorial: MySQL deletes the contents of the database. For more related articles, please pay attention to the PHP Chinese website (m.sbmmt.com)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template