The method of deleting Database in MySQL
This article mainly introduces the method of deleting database by MySQL, which is very detailed and has certain reference value. Friends who are interested must finish reading it.
MySQL delete database method: 1, use drop command to delete database, code is [drop database;]; 2, use PHP script to delete, code is [mysqli_query (connection,query,resultmode);].
MySQL method to delete the database:
1. Drop command to delete database
Drop command format:
Drop database
For example, delete a database named RUNOOB:
Mysql > drop database RUNOOB
2. Delete the database using mysqladmin
You can also use the mysql mysqladmin command to execute the delete command on the terminal.
The following example deletes the database RUNOOB (which was created in the previous section):
[root@host] # mysqladmin-u root-p drop RUNOOBEnter password:*
After executing the above delete database command, a prompt box appears to confirm that the database is actually deleted:
Dropping the database is potentially a very bad thing to do.Any data stored in the database will be destroyed.Do you really want to drop the 'RUNOOB' database [yhampN] yDatabase "RUNOOB" dropped
3. Delete the database using PHP script
PHP uses the mysqli_query function to create or delete an MySQL database.
This function takes two arguments and returns TRUE on successful execution, or FALSE otherwise.
Grammar
Mysqli_query (connection,query,resultmode)
Example
The following example demonstrates the use of the PHP mysqli_query function to delete a database:
Delete database
The above are all the contents of MySQL's method of deleting the database. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!