Got error: 1290: The MySQL server is running with the –secure-file-priv option so it cannot execute this statement when executing ‘SELECT INTO OUTFILE
今天在使用mysqldump
命令导出数据时,出现Got error: 1290: The MySQL server is running with the –secure-file-priv option so it cannot execute this statement when executing ‘SELECT INTO OUTFILE’错误。
如图:
出现此错误原因是因为在使用mysqldump
命令导出数据时如果加了-T
参数,代表导出两份文件,一份是.sql
,另一份是.txt
文件。而-T
参数导出的数据文件必须是要在指定目录下才可以。
- 查看当前mysql的默认导出路径:
mysql> select @@secure_file_priv;
+-----------------------+
| @@secure_file_priv |
+-----------------------+
| /var/lib/mysql-files/ |
+-----------------------+
1 row in set (0.00 sec)
mysql>
当前数据库导出的文件必须要在/var/lib/mysql-files/
文件下才可以,否则就会出现刚刚的错误。
- 重新导出:
mysqldump -uroot -padmin -T /var/lib/mysql-files/ test userinfo
进入/var/lib/mysql-files/
查看导出的文件:
问题解决!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/131834.html