Mysql load data local - errcode: 2
Results 1 to 5 of 5

Thread: Mysql load data local - errcode: 2

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Posts
    6

    Mysql load data local - errcode: 2

    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.

    Both mysql's are 2.66 versions.

    I am now totally confused

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Chicago, IL
    Posts
    339

    RE: Mysql load data local - errcode: 2

    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)

    -sridhar

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    6

    RE: Mysql load data local - errcode: 2

    Thanks sridhar, but I have already tried that.

    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.

    I have renamed the file as well.

    There must be something I am missing!

    Any Ideas??

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Chicago, IL
    Posts
    339

    RE: Mysql load data local - errcode: 2

    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?

    -sridhar

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Posts
    6

    RE: Mysql load data local - errcode: 2

    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.

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •