clear table mysql code example
Example 1: clear a table in mysql
truncate tableName
Example 2: mysql empty a table
TRUNCATE TABLE tblYourTable;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE YourTable1;
TRUNCATE YourTable2;
SET FOREIGN_KEY_CHECKS = 1;
DELETE FROM tblYourTable WHERE condition;
DELETE FROM tblYourTable LIMIT row_count;
Example 3: remove all records from table mysql
DELETE from tableName;
TRUNCATE tableName;
Example 4: delete all content in table mysql
TRUNCATE tablename
Example 5: how to delete all the rows in a table without deleting the table in mysql
delete from tableName;