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

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 ...

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