MySQL Error 29. SQL not using correct file path - mysql

Working on using the LOAD DATE INFILE syntax to import my csv files into my database. Using windows 10.
Originally when using this syntax I was getting ERROR 1290 which I resolved by adding: secure-file-priv = "" to the .ini file.
I no longer get ERROR 1290 but when i use:
LOAD DATA INFILE 'C:\Users\ovoJa\Downloads\VEN01_562.csv'
INTO TABLE venom
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
I get this ERROR 29:
File 'C:\ProgramData\MySQL\MySQL Server 8.0\Data\UsersovoJaDownloadsVEN01_562.csv' not found (OS errno 2 - No such file or directory)
Why is it still looking in the Programdata file for the .csv file?

try to use this C:\\Users\\ovoJa\\Downloads\\VEN01_562.csv

Related

How can I resolve 1290 error code in MYSQL 8.0

I've searched and found several proposed solutions to this however, none work.
I'm attempting to run the commands below:
LOAD DATA INFILE 'd:\ProgramData\MySQL\MySQL Server 8.0\Uploads\pa_ballot_request'
INTO TABLE pa_ballot_request
FIELDS TERMINATED BY ',' ENCLOSED BY ''
LINES TERMINATED BY '\r\n'
IGNORE 1 ROWS
I'm getting the 1290 error: MySQL server is running with the –secure-file-priv”
The secure-file-priv line is pointing to the directory where my *.csv is located yet I still get the error.
I've tried commenting out the secure-file-priv line in my.ini and I continue to get the error.
I've turned off the Safe Updates option in MySQL Workbench.
I'm running MySQL 8.0.21
Instead of commenting it, change the value of the variable into null.
In the notepad where you find secure-file-priv line, write the following line:
secure-file-priv=""
This solves the problem in MySQL 8.0
After solving this, you may get Error 29 while execution, which is incorrect file path. This can be solved by using \\ in place of \ in the path line.
I have attempted changing all of the \ to / as well as \\ which I had seen other mentioning has worked for them on older versions of MySQL. This modification did not work for me.

Load input table not honoring secure_file_priv

I ran SHOW VARIABLES LIKE "secure_file_priv" and I got this result:
'secure_file_priv', 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\'
I loaded the csv file to the Uploads directory and ran this command:
load data infile 'C:\ProgramData\MySQL\MySQL Server 8.0\Household.csv' replace into table bb.household
fields ENCLOSED BY '"'
ESCAPED BY '\\'
;
I got the following :
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.
What am I missing? I even tried "C:\ProgramData\MySQL\MySQL Server 8.0\Household.csv" as the file path and I still got the error code above.
What am I missing? Any suggestions would be greatly appreciated.
MG

import a csv file into MySQL workbench invalid path

I try to import files using a *.csv file named import personen.csv
when i run this i get an error and the log displays an other path? how can i change this?
LOAD DATA INFILE
'C:\Users\ava\Documents\2_School\1_Informatik\M141\importPersonen.csv' INTO
TABLE persons
FIELDS TERMINATED BY ';' (PiD, Anrede, Name, Vorname, Adresse, Jahrgang, OiD);
this its ther error i get :
Error Code: 29. File 'C:\ProgramData\MySQL\MySQL Server 5.7\Data\UsersavaDocuments2_School1_InformatikM141importPersonen.csv' not found (Errcode: 2 - No such file or directory)
I did already change the my.ini file line to this secure-file-priv="" to import from everywhere
Thanks for the help :D

Can't load a file to mysql table: Errcode: 2 - No such file or directory

I want to load file into a table. I am using this command.
LOAD DATA LOCAL INFILE 'home/myuser/Documents/my_project/project_sub_directory/project_sub_directory2/project_sub_directory3/my_data_file.txt'
INTO TABLE `mydatabse`.`my_table`
fields terminated BY ',';
I use LOCAL in the command to avoid the following error (an avoid moving my data files to another directory):
Error Code: 1290. The MySQL server is running with the
--secure-file-priv option so it cannot execute this statement
After executing the command, I get this error:
Error Code: 2. File
'home/myuser/Documents/my_project/project_sub_directory/project_sub_directory2/project_sub_directory3/my_data_file.txt'
not found (Errcode: 2 - No such file or directory)
How to resolve the issue without moving my data file to another directory?

Load data infile in mysql not working

i am using the mysql LOAD DATA INFILE, to insert values from csv file to database table.
but here i am using this LOAD DATA INFILE statement in run.sql file, and the t.csv file is also there with run.sql.
When i run the run.sql this line is causing error.if i give the entire path with.csv file name. then it is inserting the values to tables.
how to make it relative path?
LOAD DATA INFILE 't.csv' INTO TABLE movie FIELDS TERMINATED BY ',';
sample from t.csv
,Bulls,dsda
,Bulls,rest
,Bulls,ests
,Bulls,rsts
,Bulls,rets
error message
ERROR 29 (HY000) at line 112: File '/var/lib/mysql/t.csv' not found (Errcode: 2)
A relative filename is interpreted relative to the current working directory when the client program was started, as mentioned in the documentation.
If you did not start the client in /var/lib/mysql the file will not be found.