How to solve the secure-file-priv problem when exporting data from MySQL,
ERROR 1290 (HY000): The MySQL server is running with the-secure-file-priv option so it cannot execute this statement.
For the above errors, I believe that most of you will encounter the first MySQL Data export operation. The reason for this error is very simple: we do not know where the default MySQL export directory is, or even know that MySQL has restrictions on the data export directory. This is actually normal, because we cannot know everything, as long as we find the correct solution and remember it after a problem occurs! Learning is a process of continuous accumulation.
Next, let's take a look at how to solve this problem: After we install MySQL, a name named my will be automatically generated. ini configuration file, which records all default configurations of MySQL, such as the port number, default character set, and default storage engine. The configuration file is located in the hidden folder ProgramData. For details about how to find the hidden folder, refer to the detailed method for viewing the location of the MySQL data file.
In addition, you can run the following command to view the current value of secure-file-priv:
Show variables like '% secure % ';
Run the preceding command to perform the test:
As shown in, the secure-file-priv value I set is D:/CoderLife/testMySQL, and the default value of MySQL is:
Secure-file-priv = "C:/ProgramData/MySQL Server 5.7/Uploads"
You can view and modify the my. ini configuration file:
As shown in, I commented out the default MySQL value and modified it to the path specified by myself. In fact, after we modify the content of this configuration file, for example, modifying the default value of secure-file-priv, We must disable MySQL and restart it to make it take effect. Here, we need to note that:Disabling MySQL is not a simple application.ExitCommand to exit MySQL or close the MySQL window. Instead, close the MySQL service and restart the service.. For details about how to enable and disable the MySQL service, refer to the problem and solution after entering the password of the MySQL database.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.