While preparing a set of student instructions to create a MySQL 8
(8.0.21) Windows 10 instance I found an error with
LOAD
command and the --secure-file_priv
variable set in the my.ini
file. After granting the
global FILE
permission to the previously provisioned
student
user:
GRANT FILE ON *.* TO 'student'@'localhost';
Any attempt to run the following command failed:
LOAD DATA INFILE 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\avenger.csv'
INTO TABLE avenger
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n';
and, raise this error message:
ERROR: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
The following covers my exploration to try and fix this error
without removing a designated directory for secure file uploads.
While MySQL 5.7 …
[Read more]