MySQL进行文件操作
我执行了这条命令:
1 | select concat('KILL ',id,';') from information_schema.processlist where COMMAND='Query' AND time > 10 into outfile '/tmp/a.txt'; |
报错: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
查询 MySQL 的安全文件目录
1 | mysql> show variables like '%secure%'; |
文件可以写入到这个目录,修改一下 SQL:
1 | select concat('KILL ',id,';') from information_schema.processlist where COMMAND='Query' AND time > 10 into outfile '/var/lib/mysql-files/a.txt'; |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 杂烩饭!
评论