由于MySQL的--secure-file-priv选项,select 写文件时只能向特定的目录写。
例如SQL:
SELECT '123' INTO OUTFILE '/var/www/html/1.php'
#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://*.com/questions/32737478/how-should-i-tackle-secure-file-priv-in-mysql