Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 2 of 2

This is a discussion on Load Data Local Infile in the Shared & Semi-Dedicated forum
Does "Load Data Local Infile" not work? I type in the following: load data local infile "c:\zip\junkin.txt" into table orders lines terminated by '\r\n' (amount); ...

  1. #1
    JPC Addict
    Join Date
    Nov 2001
    Posts
    121

    Load Data Local Infile

    Does "Load Data Local Infile" not work? I type in the following:

    load data local infile "c:\\zip\junkin.txt" into table orders lines terminated by '\r\n' (amount);

    And get an error:

    File 'c:\zipjunkin.txt' not found (Errcode: 2)

    But it does exist and I tried different ways of escaping the "\" and moving file to "c:\", but still no go. Am I doing something wrong?

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Where are you doing this? From a PHP script or SSH session, perhaps? If so, the script/session can't access your C: drive. You'll need to first upload the file to the server and then run the command. As long as you are running the script from the same directory as the data file (or in the case of SSH, as long as your current directory is the one that the data file is in), you should just need to use the name of the file, not the path (ie load data local infile junkin.txt into table orders...).

    Also, if you upload the file in ASCII mode (as you should), the line termination will be \n instead of \r\n.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

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