1.--secure-file-priv 无导出权限
mysql> select * from fact_sale INTO OUTFILE '/home/backup/fact_sale.csv' FIELDS TERMINATED BY ','; ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement mysql> SHOW VARIABLES LIKE "secure_file_priv"; --表示无权限 +------------------+-------+| Variable_name | Value | +------------------+-------+| secure_file_priv | NULL | +------------------+-------+
2.解决
[root@instance-co02m7eu etc]# pwd /etc 修改配置可修改mysql配置文件,查看是否有 secure_file_priv =这样一行内容,如果没有,则手动添加, [root@instance-co02m7eu etc]# vi my.cnfsecure_file_priv =/home 表示限制为/home文件夹 secure_file_priv = 表示不限制目录,等号一定要有,否则mysql无法启动 修改完配置文件后,重启mysql生效 [root@instance-co02m7eu home]# service mysqld restart