Import Excel Data into MySQL

Sunday, April 16, 2017

Import Excel Data into MySQL :-

To import data from Excel is very simple using the LOAD DATA command from the MySQL Command prompt. there are following steps.

Step 1. Save your Excel data as a csv file (In Excel 2007 using Save As)

Step 2. Check the saved file using a text editor such as Notepad to see what it actually looks like, i.e. what delimiter was used etc.

Step 3. Start the MySQL Command Prompt (or MySQL Query Browser – Tools – MySQL Command Line Client to avoid having to enter username and password etc.)

Step 4. Enter this command:
           LOAD DATA LOCAL INFILE 'C:\\temp\\myfile.csv' INTO TABLE database.table FIELDS TERMINATED BY ';' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (field1, field2);

Step 5. Done

0 comments:

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP