Solve the problem of secure_ file_ Priv null problem

Time:2021-10-22

Add [mysqld] in my.ini file of MySQL installation directorysecure_file_priv = ' ';Then run CMD as an administrator,

Enter MySQL / bin, stop the MySQL service net stop mysql, restart the MySQL service net start mysql,

Login


mysql mysql -u root -p enter password: password

Execute commandshow variables like '%secure%';seesecure_file_privValue of.

Note: Secure_ file_ Priv is the location where load data can be imported and exported.

Supplement: MySQL modifies secure in the configuration file my.ini_ file_ Priv does not take effect

There are three ways to modify export file address settings by mysql

secure_file_privNull prohibits exporting filessecure_file_priv=""

secure_file_privThe specified address limits that the export address can only be heresecure_file_priv=“D:/”

secure_file_privIf it is empty, it can be exported to any filesecure_file_priv=

This configuration can only be modified in my.ini,

Encountered before changing secure in my.ini_ file_ Priv = changing to various formats will not take effect

I struggled all night and found a solution after research

The administrator CMD enters the DOS command interface

Enter MySQL — help to view the limited folders of MySQL read files

Move the modified my.ini file to one of the folders

Net stop mysql, net start MySQL restart the service and log inshow variables like “%secure%”; You can see success

Supplement: the MySQL configuration file my.ini does not work

First, you should know which my.ini is running.

Most of my.ini is located in the root directory of the MySQL installation directory.

Check the configuration file of which folder is started under your MySQL service in the service

As shown in the figure, go to the correct directory to find the running file.

There are two solutions:

Recommend the second handle, simple and rough.

1. Change the path above to your own path of my.ini. (it should be modified under the registry)

2. Directly find the file in the directory above, copy your configuration file to the directory or modify it directly.

(the program data folder is hidden by default. Just check show hidden folders in the folder option)

The above is my personal experience. I hope I can give you a reference, and I hope you can support developpaer. If you have any mistakes or don’t consider completely, please don’t hesitate to comment.