Mysql数据库导出到文件,提示The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
一些版本的mysql对通过文件导入导出作了限制,默认不允许,
查看配置,执行mysql命令
SHOW VARIABLES LIKE "secure_file_priv";
如果value值为null,则为禁止,如果有文件夹目录,则只允许改目录下文件(测试子目录也不行),如果为空,则不限制目录;
SHOW VARIABLES LIKE "secure_file_priv";
select * into outfile '/var/lib/mysql-files/ok.xls' from oktable order by cat_id desc limit 0,20;