LOAD DATA LOCAL INFILE "C:/TGR26163P.csv" INTO TABLE L26163 FIELDS TERMINATED BY ',';
Using the above I am receiving "file __not found Errcode:2"
I used the file with out the "LOCAL" to load a database on my machine, but when I go to the server, I get the error message.
The file is on my local C: drive. I have tried forward slashes, backslashes, double backslashes, single quotes, double quotes. I have used different combinations of caps and no caps, nothing seems to avoid "file 'C:/TGR26163P.csv' not found.
The full script includes CREATE and DROP commands that work perfectly on my local copy of mysql.
I don't understand your scenario: are you saying you cannot load a file from your local machine on a mysql server running on a remote machine?
If your file is in the same machine as the mysql server, then have you checked to see if mysql has permission to load the file? (i assume so, since it's windows).
Try this:
... INFILE 'C:\\TGR26163P.csv' ...
(two backslashes because you need to escape the second backslash)
You are correct I am trying to load the file to a remote server. I already loaded it to my server on windows and it worked perfectly. I added the LOCAL and tried the remote server and it would not work. The script has a DROP AND A CREATE which work perfectly on the remote server.
I have tried each of the following to no avail:
LOAD DATA LOCAL INFILE "C:\\TGR26163.csv" INTO TABLE L26163 FIELDS TERMINATED BY ',';
and
LOAD DATA LOCAL INFILE "C:/TGR26163.csv" INTO TABLE L26163 FIELDS TERMINATED BY ',';
I have replaced the double quotes with single quotes. I have use different capitalization schemes for the filename.
Well, you cannot load a remote file from the mysql server because it has no way to access the file (unless you connect to another mysql server to get the data from).
Have you tried FTP'ing the file to the server mysql is on and then running the command?
I am connecting to my remote site through a netadmin connection through a program called phpMyAdmin version 2.2.2. I have used this in the past, but not with a LOAD DATA LOCAL INFILE command.
The FTP may be my only workaround, I would rather make this remote thing work.
Bookmarks