Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Auto-create table based on CSV file?

3,116 views
Skip to first unread message

Richard Edwards

unread,
Mar 4, 2009, 10:07:40 AM3/4/09
to
Is it possible to load a csv file and MySQL autocreate a table based on the
contents?

Thanks

Richard

Michael Austin

unread,
Mar 4, 2009, 12:23:26 PM3/4/09
to

obviously you have not searched the docs.. this may or may not be what
you are looking for:

http://dev.mysql.com/tech-resources/articles/csv-storage-engine.html

but initial review indicates you will still need to create the table
first using Engine:csv..

Richard Edwards

unread,
Mar 4, 2009, 12:33:14 PM3/4/09
to
thanks very much.

i had looked through the docs but not being a developer or database guru i
had no idea what to look for...

"Michael Austin" <mau...@firstdbasource.com> wrote in message
news:lQyrl.19198$c45....@nlpi065.nbdc.sbc.com...

toby

unread,
Mar 4, 2009, 1:58:50 PM3/4/09
to

Use CREATE TABLE to define column names and types. Then you can very
easily use LOAD DATA INFILE to import the data from CSV.

http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Or see Michael's suggestion.

aminr...@gmail.com

unread,
Apr 26, 2013, 11:06:52 PM4/26/13
to
Did you find the answer?

Jerry Stuckle

unread,
Apr 26, 2013, 11:39:15 PM4/26/13
to
After over 4 years, I very much doubt he's going to answer.

But then it's only the Google Groupies who would expect an answer after
that long.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Luuk

unread,
Apr 27, 2013, 3:49:48 AM4/27/13
to
Google has a link to an interesting post about that....

it can be found here:
http://stackoverflow.com/questions/9998596/create-mysql-table-directly-from-csv-file-using-the-csv-storage-engine
0 new messages