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

Copy full table

  1. On destination: Create the table with the same definition as on the source:
mysql> USE test;mysql> CREATE TABLE IF NOT EXISTS `event_history`(  `event_id` int(11) NOT NULL,  `event_name` varchar(10) DEFAULT NULL,  `created_at` datetime NOT NULL,  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,  `event_type` varchar(10) NOT NULL,  `msg` tinytext NOT NULL,  PRIMARY KEY (`event_id`,`created_at`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4PARTITION BY RANGE (to_days(`created_at`))(PARTITION 2017_oct_week1 VALUES LESS THAN (736974) ENGINE = InnoDB, PARTITION p20171008 VALUES LESS THAN (736975) ENGINE = InnoDB, PARTITION p20171009 VALUES LESS THAN (736976) ENGINE = InnoDB, PARTITION p20171010 VALUES LESS ...

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