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

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

例如SQL:

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

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

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

 

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

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

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

 

上一篇:js实现cookie有效期至当次日凌晨


下一篇:学习tornado:安全