博主尝试将数据库查询结果导出到原目录下test.txt。
导出命令格式:
mysql> select * from table1 where id='001' into outfile 'test.txt';
错误信息:
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
一.错误分析
尝试将查询信息导出时候遇到该问题。
原因是:在安装MySQL的时候限制了导入与导出的目录权限,只有将查询结果导出到设定的目录下。
二.解决办法
首先进入数据库使用以下命令查看当前的secure-file-priv值
mysql> show variables like '%