[Nelug] MySQL and Importing
Stephen Patterson
steve at patter.mine.nu
Fri Jan 27 23:17:04 UTC 2006
On 27 Jan 06, Dougie Nisbet (dougie at highmoor.co.uk) wrote:
>
> Does anyone have much experience of importing data into MySQL?
> Exported as CSV, with fields enclosed in quotation marks. As you can
> see, the fields are multilined.
> recipe,srvs,source,sourcenotes,ingredients,method,time,cooktime,Not
>
> load data infile '/tmp/k2' into table recipe fields enclosed by '"'
> ;
Do the records all start with recipe? If they do then I believe this should
work
LOAD DATA INFILE '/tmp/foo' INTO TABLE recipe FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' LINES STARTING BY 'recipe';
> Finally, I'm normally a CLI fan and avoid GUIs. But if I'm going to be
> typing in a load of recipes I thought I'd investigate the GUI
> front-ends to mysql. Does anyone use any or have any recommendations?
> I'm running Debian.
For something like this (mainly to avoid typing SQL each time) I'd whip up a
bit of perl CGI with a few webpages. Most of the generic admin GUI's
(phpmyadmin, MysqlGUI) would probably mean you have to type SQL each time.
--
Stephen Patterson steve at patter.mine.nu http://patter.mine.nu/ GPG: E3E8E974
Jabber: patter at jabber.earth.li MSN: stephenpatterson893 at hotmail.com
GMail invites to anyone who wants one
"Whoever said nothing is impossible never tried slamming a revolving door."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/durham/attachments/20060127/1915520a/attachment.pgp
More information about the Nelug
mailing list