In my hosting account I have set up a database named george. There is one table named "news". There are three fields "id" (primary key), "date", and "text". I am keeping this simple for illustration. What is the best/easiest/fastest way to import the data or records to the table via mysqladmin import text file??? Thanks
printman55
0
Light Poster
Recommended Answers
Jump to PostIt depends on your source. Importing an SQL file is probably the fastest as it requires no parsing. You can also import from CSV. If your source is a table, you can just copy it in with a query (provided you can connect to both).
Jump to Post@priteas: As far as I know you're wrong. CSV import is always the fastest with MySQL. If there are foreign keys, foreign key checking should be disabled during import for speed.
Jump to PostReally, even though sql file is ready to go and the csv has to parsed and validated ? Impressive if that is true. Do you have any resources on this ?
Jump to PostWhat data ? A CSV file ?
Jump to PostThe code from the mysql prompt goes like
load data infile "george.csv" into table george fields terminated by "\t";
See http://dev.mysql.com/doc/refman/5.1/en/load-data.html
@priteas: No, I only remember dimly to have …
All 25 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
smantscheff
265
Veteran Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
printman55
0
Light Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
smantscheff
265
Veteran Poster
printman55
0
Light Poster
drjohn
56
Posting Pro in Training
printman55
0
Light Poster
mwasif
10
Posting Whiz
printman55
0
Light Poster
smantscheff
265
Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.