MySQL – Truncate Table

Use MySQL TRUNCATE TABLE statement to delete all table content. This doesn’t remote table structure. The truncate table also reset the auto increment values. Syntax: TRUNCATE TABLE table_name MySQL Truncate Table Statement For example to remove all data from table named users use following command. You must select database first before running below command.

Example – MySQL Truncate Table For example, I have a table named users with following records in a database. First, check the available data in the table. After that truncate table and again check.

Read More