问题
由于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://stackoverflow.com/questions/32737478/how-should-i-tackle-secure-file-priv-in-mysql