If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Need help with tutorial...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-07-06, 03:03
bryanandorawin bryanandorawin is offline
Registered User
 
Join Date: Aug 2006
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 08-07-06, 08:45
dbmab dbmab is offline
Registered User
 
Join Date: Apr 2006
Location: Denver, Co. USA
Posts: 240
Try this syntax - 'C:/PET.TXT'
Reply With Quote
  #3 (permalink)  
Old 08-17-06, 11:03
jwedeking jwedeking is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On