In mysql databases, the delete and truncate statements and the truncate table statements can be used to DELETE data. However, they are different, the following describes two common methods for empty mysqll table content: delete and truncate. The delete statement without the where parameter can delete all content in the mysql table. You can also use the truncate table to clear all content in the mysql table. In terms of efficiency, truncate is faster than delete, but after truncate is deleted, mysql logs are not recorded and data cannot be recovered. Www.2cto.com 1. The syntax structure of truncate is: SQL code TRUNCATE [TABLE] tbl_name. Below is a simple example: to delete all the records in the test TABLE, you can use the following statement: SQL code truncate table test; 2. delete is a bit like deleting all records in the mysql table, and truncate is equivalent to retaining the structure of the mysql table and re-creating the table, all statuses are equivalent to new tables. Its syntax structure is: SQL code DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name [WHERE where_definition] [ORDER BY...] [LIMIT row_count] According to the above syntax structure, you can use the following SQL statement to delete all records whose infoId is equal to abced in the test table: SQL code delete from test where infoId = 'abced '; Note: from the syntax structure, we can see that, like the update syntax, We can omit the where clause. However, this is a very dangerous behavior. If the where clause is not specified, delete will delete all records in the table and delete them immediately. Even if you want to cry, there is no time, because you need to acknowledge the error with the supervisor immediately, and immediately finds mysql logs and rolls back and forth records. In summary, the truncate command is fast and fast, but it is not as secure as the delete command for transaction processing. Therefore, if the table to be deleted by truncate is being processed in a transaction, this command will generate an exit and generate an error message.