【mysql数据库导出文件报错】The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

报错场景:使用 into outfile 导出文件时报错。

运行:

show variables like '%secure%';

查看“secure_file_priv”的值

【mysql数据库报错】The MySQL server is running with the --secure-file-priv option so it

改成在此路径下就可以:

select * from gdzq_gjk.o_ls_xgj_zxjqtj into outfile '/var/lib/mysql-files/test.txt' fields terminated by "," optionally enclosed by '"';

 

若想更换导出路径,则可以修改配置文件:

 

【mysql数据库报错】The MySQL server is running with the --secure-file-priv option so it

 

相关文章: