When exporting data with MySQL 5.7, an error was reported. The error was reported as follows:
Annotated is the correct file path, we will export files in this directory.
For SQL instructions, modify as follows:
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
According to the wrong information, we found that secure-file-priv will specify the folder as the place where the exported files are stored, so we can find this folder first.
Solution 1:
enter the following command in the MySQL command line interface:
show variables like '%secure%';
Annotated is the correct file path, we will export files in this directory.
For SQL instructions, modify as follows:
SELECT * FROM User details WHERE gender='male'
INTO OUTFILE 'C:\\ProgramData\\MySQL\\MySQL Server 5.7\\Uploads\\man.txt'
The file can be successfully exported to this directory.
Solution 2:
Go to the installation path C:\ProgramData\MySQL\MySQL Server 5.7, find my. Ini file and modify the default save path of Secure-file-priv.
Secure_file_prive =null — mysqld does not allow import and export
secure_file_priv=/ TMP/– limits the import and export of mysqld to only occur in the/TMP/directory
secure_file_priv= “” — does not restrict the import and export of mysqld
Read More:
- How to Solve MYSQL into outfile Error13
- MySQL character set error resolution: err=Error 3988: Conversion from collation utf8mb4_unicode_ci into utf8_general_ci impo
- How to Solve Mysql8 load data error
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MYSQL8 Startup Error: mysqld_safe error: log-error set to ‘/var/log/mariadb/mariadb.log‘
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- [Solved] sqoop Import Datas to mysql error: ERROR tool.ExportTool: Error during export: Export job failed
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- How to Solve mysqld — console command error
- [Solved] ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] Error 1044: Access denied for user ‘syz-remote‘@‘%‘ to database ‘webapp‘
- Linux Error: [ERROR] –initialize specified but the data directory has files in it. Aborting.
- [Solved] mariadb Startup Error: Job for mariadb.service failed because the control process exited with error code.
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]
- Mysqldump: Got error: 1045: Access denied for user ‘root‘@‘localhost‘
- Mysql ERROR 1067: Invalid default value for ‘date’ [How to Solve]