O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TRUNCATE partitions

If you wish to keep PARTITION DEFINITION in the table and remove only the data, you can execute the TRUNCATE PARTITION command:

mysql> ALTER TABLE event_history TRUNCATE PARTITION p20171001;Query OK, 0 rows affected (0.08 sec)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required