【Error】SELECT INTO OUTFILE报错:MySQL server is running with the --secure-file-priv

版权声明:随意转载,需注明出处。by think_ycx https://blog.csdn.net/think_ycx/article/details/89213948

由于MySQL的--secure-file-priv选项,select 写文件时只能向特定的目录写。

例如SQL:

SELECT '123' INTO OUTFILE '/var/www/html/1.php'

报错log:文档

#1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

通过SHOW VARIABLES LIKE "secure_file_priv";可以查询可写的目录。

参考:https://stackoverflow.com/questions/32737478/how-should-i-tackle-secure-file-priv-in-mysql

猜你喜欢

转载自blog.csdn.net/think_ycx/article/details/89213948