Import CSV file directly into MySQL

You can use mysql to import directly a csv file . You do not need to make a script to do this anymore

From an Excel file , you need to export it as CSV ,  Remove the CSV Headers and the Excel data  from the file ,  and after that it can be inserted in MySql

Here is an example :

load data local infile ‘your.csv’ into table tblUniq
fields terminated by ‘,’
enclosed by ‘”‘
lines terminated by ‘\n’
(yourName, yourCity, yourComments)

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

To prove that you're not a bot, enter this code
Anti-Spam Image