To delete a table from MySQL, use the following steps: 1. Connect to the server; 2. Select the database containing the table; 3. Use the DROP TABLE command and specify the table name to delete the table. Example: DROP TABLE users;
How to delete a table from MySQL
Deleting a table in MySQL is a simple Direct operations can free up database space and simplify management. Here's how to do it:
Step One: Connect to MySQL
Connect to your MySQL server using the MySQL client or command line tools.
Step 2: Select the database
Use the USE
command to select the database containing the table to be deleted:
<code class="sql">USE database_name;</code>
Step 3: Delete the table
Use the DROP TABLE
command to delete the table:
<code class="sql">DROP TABLE table_name;</code>
where table_name
is the table to be deleted name.
Example:
<code class="sql">USE my_database; DROP TABLE users;</code>
This command will delete the table named users
from the my_database
database.
Note:
The above is the detailed content of How to delete one of the tables in mysql. For more information, please follow other related articles on the PHP Chinese website!