| ||||
Loading a table from data in a text file Posted by admin (Graham Ellis), 11 October 2003 I'm often asked how to load data in a text file into a table. It can be done with load data infile, which has flexibility to handle different field and line delimiters, and can even handle fields that might or might not be encased in quotes. Here's an example that includes a load data infile using a number of the options.Quote:
Posted by Custard (Custard), 11 October 2003 As an addendum, that may be 'deprecated' now, last time I wanted to do this (on a solaris machine) I had to run the mysql program with.. mysql -uUser -p --local-infile=1 ... or it wouldn't work. Something to do with security afaicr. I noted we didn't have to do it on the course, but we were using windows.. HTH Posted by admin (Graham Ellis), 11 October 2003 You can sayLOAD DATA LOCAL INFILE rather than LOAD DATA INFILE and this will cause the data to be loaded from the client's disc rather than the server's disc. The --local-infile option enables / disables the LOAD DATA LOCAL INFILE capability - in other words, it controls whether or not you can load data from the client's disc. I don't think it effects the regular LOAD DATA INFILE command which loads data from the server's discs. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
| ||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |