Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    1

    Unanswered: Need help with tutorial...

    I am new to MySQL. I am going through the tutorial. I came to the part where they tell you how you can make MySQL read in a text file. I put my file PET.TXT into the C:\ directory and then typed and recieved the following message:

    mysql> LOAD DATA LOCAL INFILE 'C:\PET.TXT' INTO TABLE PET;
    ERROR 2 (HY000): File 'C:PET.TXT' not found (Errcode: 2)


    1) where should I put my text file
    2) is this the right command for reading in the file

    Thank you for helping in advance.
    Bryan

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    Try this syntax - 'C:/PET.TXT'

  3. #3
    Join Date
    Dec 2003
    Location
    Topeka, Ks
    Posts
    4
    Note that if you created the file on Windows with an editor that uses \r\n as a line terminator, you should use:

    mysql> LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet
    -> LINES TERMINATED BY '\r\n';


    note example from mysql help - "Lines Terminated by \r\n" was recomended in Windows

Posting Permissions

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