Copying individual partitions of a table

You added a new partition of the events_history table on the source and you wish to copy only the new partitions to the destination. For the sake of your understanding, create new partitions on the events_history table and insert a few rows:

mysql> ALTER TABLE event_history ADD PARTITION(PARTITION p20171018 VALUES LESS THAN (736985) ENGINE = InnoDB, PARTITION p20171019 VALUES LESS THAN (736986) ENGINE = InnoDB);Query OK, 0 rows affected (0.06 sec)Records: 0  Duplicates: 0  Warnings: 0mysql> INSERT INTO event_history VALUES(9,'test','2017-10-17','2017-10-17','click','test_message'),(10,'test','2017-10-18','2017-10-18','click','test_message');Query OK, 1 row affected (0.01 sec)mysql> SELECT * FROM event_history ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.