· 7 years ago · Oct 05, 2018, 11:50 AM
1mysql> source ~/table.sql
2
3Query OK, 0 rows affected (0.01 sec)
4
5Query OK, 0 rows affected (0.00 sec)
6
7...
8
9Query OK, 2550 rows affected (0.08 sec)
10Records: 2550 Duplicates: 0 Warnings: 0
11...
12
13Query OK, 2576 rows affected (0.06 sec)
14Records: 2576 Duplicates: 0 Warnings: 0
15
16DROP TABLE IF EXISTS `table_name`;
17
18CREATE TABLE `table_name` (
19 `id` bigint(20) NOT NULL AUTO_INCREMENT,
20 `created_at_in_millis` bigint(20) DEFAULT NULL,
21 `code` varchar(40) DEFAULT NULL,
22 `status` varchar(40) DEFAULT NULL,
23 PRIMARY KEY (`id`),
24 UNIQUE KEY `unique_index` (`created_at_in_millis`,`code`,`status`)
25) ENGINE=InnoDB AUTO_INCREMENT=8645259 DEFAULT CHARSET=utf8;
26
27insert into ...