实验如下:
建表:
mysql> CREATE TABLE `test` (
-> `id` varchar(64) NOT NULL,
-> `ecode` varchar(10) DEFAULT NULL,
-> `type` varchar(12) DEFAULT NULL,
-> `timeid` varchar(12) DEFAULT NULL,
-> `start_time` date DEFAULT NULL,
-> `end_time` varchar(12) DEFAULT NULL,
-> PRIMARY KEY (`id`),
-> KEY `start` (`start_time`),
-> KEY `end` (`end_time`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.35 sec)
mysql>
mysql>
插入数据:
mysql> insert into test select * from date_rule;
Query OK, 1412 rows affected (0.49 sec)
Records: 1412 Duplicates: 0 Warnings: 0
不带表头:
mysql> select * from test into outfile 'd:\test.csv' fields terminated by ','enclosed by '"'lines terminated by '\r\n';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
导出报错,原因是5.7版本对mysqld 的导入导出做限制&#
建表:
mysql> CREATE TABLE `test` (
-> `id` varchar(64) NOT NULL,
-> `ecode` varchar(10) DEFAULT NULL,
-> `type` varchar(12) DEFAULT NULL,
-> `timeid` varchar(12) DEFAULT NULL,
-> `start_time` date DEFAULT NULL,
-> `end_time` varchar(12) DEFAULT NULL,
-> PRIMARY KEY (`id`),
-> KEY `start` (`start_time`),
-> KEY `end` (`end_time`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.35 sec)
mysql>
mysql>
插入数据:
mysql> insert into test select * from date_rule;
Query OK, 1412 rows affected (0.49 sec)
Records: 1412 Duplicates: 0 Warnings: 0
不带表头:
mysql> select * from test into outfile 'd:\test.csv' fields terminated by ','enclosed by '"'lines terminated by '\r\n';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
导出报错,原因是5.7版本对mysqld 的导入导出做限制&#