tags:

views:

126

answers:

2

Hi all,

Will any one explain "How to IMPORT a MICROSOFT EXCEL file in to MYSQL DATABASE".

For Example MY EXCEL TABLE LOOKS LIKE THIS.

Country Amount Qty

America 93 0.60

Greece 9377 0.80

Australia 9375 0.80

Thanks in Advance.

Fero

+2  A: 

You might take a look at this thread on the MySQL forums. It explains how to do exactly what you want.

Lucas McCoy
Thanks for your support Lucas
Fero
@Fero: Then upvote me. I addicted to rep man ;-)
Lucas McCoy
+3  A: 
  1. Export port it into some text format. The easiest will probably be a tab-delimited version, but CSV can work as well.

  2. Use the load data capability. See http://dev.mysql.com/doc/refman/5.1/en/load-data.html

  3. Look half way down the page, as it will gives a good example for tab separated data:

    FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\'

  4. Check your data. Sometimes quoting or escaping has problems, and you need to adjust your source, import command-- or it may just be easier to post-process via SQL.

ndp
Thanks NDP. I got it...
Fero