MySQL Forums
Forum List  »  Newbie

Posted by: Jason Kapalczynski
Date: April 20, 2009 09:35AM

I am trying to import a comma delimited txt file into MySQL database

I seen stuff like this, but being a Newbie I am confused.

load data local infile 'uniq.csv' into table tblUniq
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(uniqName, uniqCity, uniqComments)

1. First off I dont even know where to write the script in MySQL
2. Second it appears that I have to have an existing table to import into

The table I want to import has a bunch of I need to actually make the template table in MySQL first then import into that table...

I hope not...that seems a bit combersome...Cant I just import an existing file without having to create the table in MySQL first...

THanks in Avance...

Options: ReplyQuote

Written By
April 20, 2009 09:35AM
April 20, 2009 10:52AM
April 20, 2009 02:56PM
April 21, 2009 09:39AM
April 21, 2009 08:04AM
April 21, 2009 07:59AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.