Tips and scripts relating to database administration. Mainly SQL Server but some MySQL and every now and again something different. Posts are brief and to the point.It's as much a place to make notes for my own use as anything else.
Thursday, 10 November 2011
Loading Data into MySql Tables
The following ststement can be used to load data from a text file into a MySql table.
LOAD DATA
INFILE 'tmp/datafile.txt'
INTO TABLE schema.table
FIELDS TERMINATED BY '|'
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES;
No comments:
Post a Comment