MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 18th, 2003, 02:34 AM
andyyylz andyyylz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 14 andyyylz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to import txtfiles into mysql database

Hi all:

How to import txtfiles into mysql databases. I know the command.
But i do not know where I should put this file.
Anyone gives me a hint

Cheers
Andy

Reply With Quote
  #2  
Old July 18th, 2003, 04:43 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
A good example is to take your web server's raw access log and import it into mysql with a command such as this:

C:\temp\>mysqlimport --local -d -r -h <host>
-u <user> -p<password> --fields-terminated-by="-" <dbname> <textfile>


This assumes the textfile is in the c:\temp directory which is your current working directory.

It is very imporant you use the command line switch --local as if you do not, the mysql server will attempt to look on it's hard drive for the textfile you specified. Most likely it will not find it.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #3  
Old July 18th, 2003, 10:06 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
You can also use a query with

LOAD DATA INFILE 'file.txt' INTO TABLE table (fields);

Reply With Quote
  #4  
Old September 4th, 2003, 11:40 PM
Chino Chino is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 Chino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation OS X help

ok, so how would i do this in OS X? what's the default path?

Reply With Quote
  #5  
Old September 5th, 2003, 12:31 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
There is no default path... you need to cd to whatever directory you have the file in or reference the full path to the file you are importing.

Reply With Quote
  #6  
Old September 5th, 2003, 02:03 AM
Chino Chino is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 Chino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
tried that

yeah, well, i tried that but i must have missed the path. anyway, i just got a GUI to mysql so i dont need it right now. i'm sure in the future, importing a text file will be quicker than typing it all in. thanks for replying, though, i really appreciate it.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > How to import txtfiles into mysql database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway