ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
我在将csv文件里面的数据导入数据表时,用命令
LOAD DATA INFILE '/home/sampledata.csv' into table info FIELDS TERMINATED BY ',' IGNORE 1 LINES;
报如下错误
查了好多相关资料,是权限问题导致的,于是乎我用show variables like ‘%secure%’;这条语句查询了这个secure_file_priv 参数的值,具体方法如下:
原来是我的csv文件没有放到/var/lib/mysql-files/路径下,
后面我将要导入的csv数据文件移动到/var/lib/mysql-files/路径下,然后用chmod命令修改了了csv文件的权限
mv /home/sampledata.csv /var/