mysql 导出数据到文件 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so
来源:互联网 发布:程序员转行能干什么 编辑:程序博客网 时间:2024/05/22 12:00
在做mysql 大批量导出数据的时候,所遇到的问题如下:
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
mysql 默认对导出的目录有权限限制,也就是说使用命令行进行导出的时候,需要指定目录进行操作;
解决方法:
1. 查询mysql 的secure_file_priv 值配置的是什么,使用命令行: show global variables like '%secure%';
(我这里的配置是 secure_file_priv = /var/lib/mysql-files/)
2. 使用 into outfile 开始导出:(因为secure_file_priv配置的关系,所以必须导出到 /var/lib/mysql-files/目录下)
select * from table_name where a = 'test'
into outfile '/var/lib/mysql-files/test.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';
3.所用的几个关键字:
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ' " ' LINES TERMINATED BY '\n';
(因为导出的数据会出现一些乱码或者特殊字符,所以使用以上关键字进行转义)
- mysql 导出数据到文件 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it ...statemet
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option
- MYSQL导出数据出现The MySQL server is running with the --secure-file-priv option so it cannot execute this
- MYSQL导出数据出现The MySQL server is running with the --secure-file-priv option
- mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it can
- Windows下MySQL导入csv文件ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti
- mysql导出表到CSV文件方法及提示错误[Err] 1290 - The MySQL server is running with the --secure-file-priv option解决办法
- Error Code: 1290. The MySQL server is running with the --secure-file-priv option
- mysql>导出数据为txt时报错:The MySQL server is running with the --secure-file-priv option so it cannot execut
- The MySQL server is running with the --secure-file-priv option so it cannot execute this statement解决
- The MySQL server is running with the --secure-file-priv option so it cannot execute this statement解决
- MySQL 报错Error Code: 1290. The MySQL server is running with the --secure-file-priv option
- MYSQL导入数据出现The MySQL server is running with the --secure-file-priv
- Error Code: 1290. The MySQL server is running with the --secure-file-priv op
- MySQL 报错 ERROR 1290 (HY000): running with the --secure-file-priv
- Android通过POI架包生成Excle表格
- Zabbix的events页面非常慢且消耗大量资源
- 利用servlet 实现JAVAWeb访问微信OAuth2.0认证,获取用户信息的实例
- java小白对static修饰方法的用法总结
- 汉诺塔问题(N阶梵塔问题)
- mysql 导出数据到文件 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so
- socket编程及本地socket实现
- 打开资源文件assets
- fft
- 次优路径算法
- stm32---室内温湿度监控系统
- 靠谱大数据培训没那么简单
- 安装numpy+scipy+matlotlib+scikit-learn及问题解决
- ajax学习笔记