I am trying to enter data into a MySQL bd from a .csv file and when executing this command line:
load data infile 'C:\respaldo\respaldo.csv'
into table productos
fields terminated by ','
lines terminated by '\n'
ignore 1 lines;
I get this error:
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it can not execute this statement
Investigating on the internet, I saw this function was somewhat restricted by default and could be solved by modifying the line secure-file-priv =
in the configuration file my.ini, some suggesting that it should equal 1 and others as a empty string. Anyway, the fact is that I can not find that line in the configuration file, I tried to add it in the%% of% or%% of both forms, both equal to 1 and empty string and it does not work. In other forums I found that the problem was because the variable mysqld
had the value of the path C: \ ProgramData \ MySQL \ MySQL Server 8.0 \ Data (that is seen executing the command mysql
) and that should move there the .csv file but it does not work either
I can not find the line secure-file-priv
Any ideas? I'm new to this, I use MySQL 8.0 on Windows