MYSQL 5.7 Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it..

When exporting data with MySQL 5.7, an error was reported. The error was reported 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: