How to solve the secure-file-priv problem when exporting data from MySQL,

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.