Log only the method that solves the problem.
MySQL version: 5.7.18
Problem: When executing MySQL function load_file, the function loads the contents of the specified file and stores it in the corresponding field. Such as:
Select Load_file ("D:\aa.txt");
However, the execution always returns NULL. Various slashes have been tried.
Accessed data: 1190000009333563
MySQL new version under secure-file-priv field: Secure-file-priv parameter is used to limit load DATA, SELECT ... OUTFILE, and Load_file () to which the specified directory is passed.
The value of Ure_file_priv is null, which means that the restriction mysqld does not allow import | export
When the value of Secure_file_priv is/tmp/, the import that restricts the Mysqld | Export can only occur in the/tmp/directory
When the value of Secure_file_priv does not have a specific value, it means that there is no restriction on MYSQLD import | export
How to view the value of the Secure-file-priv parameter:
1 |
show global variables like ‘%secure%‘ ; |
The default is null. Import and export is not allowed.
Modify the Mysql.ini file and add it under [mysqld]
Secure_file_priv =
Save and restart MySQL.
To perform a command view:
Execute LoadFile again:
Problem solving.
Windows MySQL read file is null