当前位置:网站首页>Export data prompt -- solution to the problem of secure file priv option
Export data prompt -- solution to the problem of secure file priv option
2022-06-11 17:08:00 【jacklin_ 001】
mysql You can use into outfile Parameters export the data in the table to csv, For example, you can use the following command to user The data of the table is exported to user.csv
1 |
|
After execution ,user Table data is exported to /tmp/user.csv.
Parameter description :
into outfile ‘ Exported directory and file name ’
Specify the exported directory and file name
fields terminated by ‘ Separator between fields ’
Define the separator between fields
optionally enclosed by ‘ Field delimiter ’
Define the characters that surround the field ( Invalid numeric field )
lines terminated by ‘ Line separator ’
Define the separator for each line
Problem analysis
The above order is in mysql5.6 There's no problem running under the , But in mysql5.7 The following error occurs when running under .
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Check out the official documents ,secure_file_priv Parameters are used to limit LOAD DATA, SELECT …OUTFILE, LOAD_FILE() To which specified directory .
secure_file_priv by NULL when , Said restrictions mysqld Import or export... Is not allowed .
secure_file_priv by /tmp when , Said restrictions mysqld Only in /tmp Perform import and export in the directory , Other directories cannot execute .
secure_file_priv When it's not worth it , Means unrestricted mysqld Import and export in any directory .
see secure_file_priv Value , The default is NULL, Indicates that restrictions cannot be imported or exported .
1 2 3 4 |
|
because secure_file_priv Parameters are read-only , Out of commission set global Command to change .
1 2 |
|
resolvent
open my.cnf or my.ini, Restart after adding the following statement mysql.
1 |
|
see secure_file_priv Modified value
1 2 3 4 |
|
After modification, execute again , Successfully exported .
';
After execution ,user Table data is exported to /tmp/user.csv.
Parameter description :
into outfile ‘ Exported directory and file name ’
Specify the exported directory and file name
fields terminated by ‘ Separator between fields ’
Define the separator between fields
optionally enclosed by ‘ Field delimiter ’
Define the characters that surround the field ( Invalid numeric field )
lines terminated by ‘ Line separator ’
Define the separator for each line
Problem analysis
The above order is in mysql5.6 There's no problem running under the , But in mysql5.7 The following error occurs when running under .
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Check out the official documents ,secure_file_priv Parameters are used to limit LOAD DATA, SELECT …OUTFILE, LOAD_FILE() To which specified directory .
secure_file_priv by NULL when , Said restrictions mysqld Import or export... Is not allowed .
secure_file_priv by /tmp when , Said restrictions mysqld Only in /tmp Perform import and export in the directory , Other directories cannot execute .
secure_file_priv When it's not worth it , Means unrestricted mysqld Import and export in any directory .
see secure_file_priv Value , The default is NULL, Indicates that restrictions cannot be imported or exported .
1 2 3 4 |
|
because secure_file_priv Parameters are read-only , Out of commission set global Command to change .
1 2 |
|
resolvent
open my.cnf or my.ini, Restart after adding the following statement mysql.
1 |
|
see secure_file_priv Modified value
1 2 3 4 |
|
After modification, execute again , Successfully exported .
1 2 |
|
边栏推荐
- 用实际案例分析PMP与ACP应该考哪个?哪个更有用?
- jsp页面初始加载方式
- C语言:使用.h和.c文件遇到的问题总结
- Environment configuration and pymysql installation
- Elasitcsearch基础学习笔记(1)
- 满k叉树编号为 i 的节点的孩子编号公式推导
- [opencvsharp] spot detection barcode decoding image operation image rotation / flip / Zoom perspective transformation image display control demo notes
- 如何把树结构存储到数据库
- 2022 national question bank and mock examination for safety officer-b certificate
- Analysis report on sales status and supply and demand prospects of phosphoric acid fuel cell industry in the world and China 2022-2028 Edition
猜你喜欢

tornado环境搭建及基本框架搭建——熟悉的hello world

A journey of database full SQL analysis and audit system performance optimization

Katalon Studio Enterprise

用实际案例分析PMP与ACP应该考哪个?哪个更有用?

Analysis report on future development trend and investment suggestions of global and Chinese soybean protein industry 2022-2028

Real time myth -- real-time RTOS multitask performance analysis

【pytest学习】pytest 用例执行失败后其他不再执行

API management artifact that allows you to call wow directly

论文阅读 dyngraph2vec: Capturing Network Dynamics using Dynamic Graph Representation Learning

Elasitcsearch basic learning notes (1)
随机推荐
web安全-靶场笔记
A set of ThinkPHP wechat applet mall source code with background management
Solr (I) installation and permission control of Solr
我的CのERROR们
Why does chip design also need "Craftsmanship"?
LeetCode-1005. K 次取反后最大化的数组和
[pytest learning] after the pytest case fails to execute, the others will not be executed
Regression prediction | realization of RBF RBF neural network with multiple inputs and single output by MATLAB
VLAN partition and routing between VLANs
ShellBrowser .NET Crack
满k叉树编号为 i 的节点的孩子编号公式推导
每周推荐短视频:菜鸟CEO谈未来物流新赛道
MATLAB中histogram函数的使用
Is the second-class cost engineer worth the exam? What is the development prospect?
Global and Chinese molten carbonate fuel cell industry outlook and market panoramic Research Report 2022-2028
网络流媒体协议的联系与区别(RTP RTCP RTSP RTMP HLS)
Leetcode-- array
ShellBrowser . NET Crack
论文阅读 dyngraph2vec: Capturing Network Dynamics using Dynamic Graph Representation Learning
LeetCode——24. Exchange the nodes in the linked list in pairs (three pointers)