导出数据:
select * from plant_breed into outfile "E:/tools/mysql/export/plant_breed.txt";
提示 The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
通过命令查看允许的导出导入目录:
show variables like '%secure%';
看到的结果是:
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
进入my.ini修改的配置,但是依然是上面的提示,弄了半天也没办法,果断改为空值,这个按照MySQL的说法是不限制了,结果依然是同样的提示。折腾了半天发现是windows下斜杠的问题。
很多同学通过查看参数,返回的是:
但是my.ini配置的却是:
所以导出目录必须和my.ini的斜杠一致方可导出。