Saturday 1 December 2012

Importing Excel Records to MySQL

How to import MS Excel records to as MySQL table?

At first before executing the below query the Excel document should converted to .csv format. For this select save as and chose file type as *.csv(Comma delimiter).

The query is as follows:

LOAD DATA LOCAL INFILE '[path://]file.csv' INTO TABLE database.tableName FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' (field1,field2,field3,.....);

Thank You!

No comments:

Post a Comment