Running MySQL on Windows
Import a csv file using Load Data InFile "{my path here}"...
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
so tedious
NO going to the secure-file-priv path and dropping your CSV in there DOES NOT WORK
"C:\ProgramData\MySQL\MySQL Server 8.0\Uploads"
NO it does not work when you open up all privs to "Everybody".
NO it does not work if you edit the ini file and set it to the folder I actually want to use
C:\ProgramData\MySQL\MySQL Server 8.0\my.ini
# Secure File Priv.
secure-file-priv="C:\folder\folder\folder"
YES I restarted MySQL Services and I said NO it didn't work.
What does work? This crap.
Set the ini file to the C:\ drive
# Secure File Priv.
secure-file-priv="C:\"
If you run your import now with ONLY C: and the csv filename in the script like so
LOAD DATA INFILE "C:\myCSV.csv"
You will get THIS nonsense error:
Error Code: 29. File 'C:\ProgramData\MySQL\MySQL Server 8.0\Data\customers_2020.csv' not found (OS errno 2 - No such file or directory)
So yeah, I'd call that a bug. I say tomato you say supercalifrackiforniaspinyourmommaspaceshuttle
Anyway, I didn't want my CSV files in the Data folder, but you can just use that and be done if you want. I wanted to use something similar to the Uploads folder the developers want you to use, but that's still up a level from here.
I just split the difference and moved the "Uploads" folder to C:\ProgramData\MySQL\MySQL Server 8.0\Data\Uploads\ then dropped my CSV filed in Uploads, then executed this script to make it ACTUALLY work
LOAD DATA INFILE "C:\Uploads\\MyCSVFile.csv"
REPLACE INTO TABLE customers
CHARACTER SET latin1
FIELDS TERMINATED BY ','
ENCLOSED BY '"'LINES TERMINATED BY '\n';
*yes I DID use two back wacks in that spot "\\". If I didn't I would get the error:
Error Code: 29. File 'C:\ProgramData\MySQL\MySQL Server 8.0\Data\UploadsMyCSVFile.csv' not found (OS errno 2 - No such file or directory)
dumb.