DavidTigerch
MIS
Hi all. I got a huge list of data in excel(7000 records) . I want to transfer it to mysql database. Could any one show me how to do it using a fast and easy method.Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LOAD DATA LOCAL INFILE 'excel.csv' INTO TABLE table_name FIELDS
TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';
CREATE TABLE `table_name` (
`id` int(10) NOT NULL auto_increment,
`column` varchar(55) NOT NULL default '',
PRIMARY KEY (`id`)
);
LOAD DATA LOCAL INFILE 'c:\albumscsv.csv' INTO TABLE sheet1 FIELDS
TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n'
MySQL said:
#2 - File 'c:albumscsv.csv' not found (Errcode: 2)
LOAD DATA LOCAL INFILE 'c:\\albumscsv.csv' INTO TABLE sheet1 FIELDS
TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n'
[code]
and i got garbage in my db !!! also when i created my csv under save as there were no csf so i had to do like this "filename.csv" and save it. Do u think that is problem i get garbage in my db?