当我们在导入错误的时候出现以下错误:
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
MySQL有一个机制就是导出的时候需要导入指定的路径下才可以成功导出
使用以下命令查询这个导出的位置
show variables like '%secure%';
如图所示
然后我们将要保存的位置改成这个目录下就可以了
示例
SELECT * FROM user_info into outfile "/var/lib/mysql-files/user_infosql.txt";
这个位置好像可以修改MySQL的配置文件进行修改但是目前我还没有学会,待我研究明白在补充到文档中吧