xhp168168 发表于 2016-08-10 17:23

导入csv文件时报错:ERROR 1290 --secure-file-priv



操作环境:SUSE Linux Enterprise Server 12 SP1

MySQL版本:5.7.14

在MySQL中建了一个数名为test的数据库,在test下建了一个表:Info,现在想把Windows下的一个aa.csv文件(编码格式GBK)导入到Info中,在Linux环境下的MySQL中使用如下命令:

mysql>load data infile '/tmp/aa.csv'

   ->into table Info

   ->character set GBK

   ->fields terminated by ',' optionally enclosed by '"' escaped by '"'

   ->lines terminated by '\r\n';

此时显示:ERROR 1290 (HY000):The MySQL server is running with the --secure-file-priv option so it cannot exeute this statement


请问高手,这是哪里出了问题,该如何解?










seesea2517 发表于 2016-08-11 14:19

xhp168168 发表于 2016-08-10 17:23 static/image/common/back.gif
操作环境:SUSE Linux Enterprise Server 12 SP1

MySQL版本:5.7.14


这是新版本的安全特性。可以在配置文件中关闭此功能重启mysql后继续用你的命令,或者看这个配置指定的是哪个目录,在该目录中进行文件操作。

lyhabc 发表于 2016-08-13 19:39

--secure-file-priv
页: [1]
查看完整版本: 导入csv文件时报错:ERROR 1290 --secure-file-priv