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 ',';
网友评论