[bigdata-001] mysql 5.7 由于安全问题不能导出数据的解决方式
2016-12-17 15:35
916 查看
1.
create user 'b1'@'localhost' identified by 'b1';
grant all privileges on *.* to 'b1'@'localhost' identified by 'b1';
2.
select oid into outfile '/home/brian/xxx.csv' from android_user_event_sorted;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
secure_file_priv设置了指定目录,需要在指定的目录下进行数据导出
show variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+
select oid into outfile '/var/lib/mysql-files/xxx.csv' from android_user_event_sorted;
select oid, userid, createtime, method, page into outfile '/var/lib/mysql-files/page_event.csv' fields terminated by '|' lines terminated by '\n' from an_user_event;
3. 这一点很重要,如果找不到资料,要在这里折腾很久。
create user 'b1'@'localhost' identified by 'b1';
grant all privileges on *.* to 'b1'@'localhost' identified by 'b1';
2.
select oid into outfile '/home/brian/xxx.csv' from android_user_event_sorted;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
secure_file_priv设置了指定目录,需要在指定的目录下进行数据导出
show variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+
select oid into outfile '/var/lib/mysql-files/xxx.csv' from android_user_event_sorted;
select oid, userid, createtime, method, page into outfile '/var/lib/mysql-files/page_event.csv' fields terminated by '|' lines terminated by '\n' from an_user_event;
3. 这一点很重要,如果找不到资料,要在这里折腾很久。
相关文章推荐
- Mysql5.5升级到5.7后MySQLdb不能正常使用的问题解决
- 解决存储过程中数据安全问题的四种方式
- MYSQL在导出数据过程中行数受限问题解决方案
- php将mysql数据表(含中文数据)导出生成excel表,快速生成且解决中文乱码问题。
- 将mongodb 数据指定字段导出,然后指定字段导入mysql 实例 及相关问题解决
- Android学习笔记-解决hellocharts折线图由于特殊数据不能展示的问题
- 解决从mysql表中多列导出数据到csv合并成一列的问题
- 解决mysql导入导出数据乱码问题
- 解决存储过程中数据安全问题的四种方式
- Mysql5.6版本导出sql文件数据导入到5.7版本出现的问题
- 解决 Oracle exp导出表数据时空表不能导出的问题
- mysql导出数据时出现--secure-file-priv 问题的解决办法
- Mysql5.6版本导出sql文件数据导入到5.7版本出现的问题解决方法
- MySQL 解决数据导出问题:Using a password on the command line interface can be insecure.
- 解决mysql导入导出数据乱码问题
- 解决存储过程中的数据安全问题的四种方式
- 【shell mysql 导出数据到csv脚本,完美解决乱码转义符等问题】-费元星
- SQL SERVER与MYSQL数据导入导出问题解决办法
- 帮助类解决日期时间问题(包含从Mysql中查出来的数据后面多了个0的问题,以友好的方式显示时间的问题)
- mysql导入导出数据中文乱码解决方法小结(1、navicat导入问题已解决,创建连接后修改连接属性,选择高级->将使用Mysql字符集复选框去掉,下拉框选择GBK->导入sql文件OK;2、phpmyadmin显示乱码的问题也解决,两步:1.将sql文件以utf8的字符集编码另存,2.将文件中sql语句中的字段字符集编码改成utf8,导入OK)