In MySql, there are two ways to delete a table:
(1) drop table table_name, which is the most commonly used method, directly delete the table to be deleted;
(2) drop database database_name, that is, delete the database where the table is located.
1. Preparation: (1) Open the mysql console; log in with the root account; display all databases; show databases.
#2. Preparation: (2) Select the database named test, use test; and then view the tables in the test database, use the show tables; command.
##4. The second method: ( 1) Type in source "absolute path/quiz.sql", re-import the quiz table into the test database, then use show tables; check the tables in the database, there is a quiz table.
#5. The second method: (2) Use drop database test; at this time, the entire test database is deleted. For further confirmation, you can use the show databases; command to check that the database obtained does not have a test database.
##Note
The command must end with;
Do not delete databases and tables casually to avoid losing important data
##
The above is the detailed content of Delete operation of table in MySql. For more information, please follow other related articles on the PHP Chinese website!