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

【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_第1张图片

改成在此路径下就可以:

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_第2张图片

 

你可能感兴趣的:(数据库)