MySQL导出数据遇到secure-file-priv问题的解决

2018-09-07  本文已影响47人  ac619467fef3

lsecure-file-priv

mysql> load data infile '/home/shop_info.txt' into table shop_info;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

show variables like '%secure%';
查看信息

mysql> show variables like '%secure%';
+------------------+-----------------------+
| Variable_name    | Value                 |
+------------------+-----------------------+
| secure_auth      | ON                    |
| secure_file_priv | /var/lib/mysql-files/ |
+------------------+-----------------------+
2 rows in set (0.00 sec)

将文件mv到/var/lib/mysql-files/文件夹下,再次执行成功。

load data插入数据NULL

指定文件分割符

load data infile "/var/lib/mysql-files/shop_info.txt" into table shop_info  \
fields terminated by ',';
上一篇 下一篇

猜你喜欢

热点阅读