I've seen a lot of questions here about how to export a sql database to excel, but I have a ton of information from an excel file that I would like to export to sql database. The file is extensive and it could take me years to transfer the info manually... years! Is there a faster easier way to do this?
8 Answers
You don't actually need to write code to do this.
Save the Excel file to CSV format and then see one of the many related questions:
- How to import CSV file to MySQL table
- How I can Import data from CSV to MySQL?
- Import CSV file directly into MySQL
The friendliest way is to use a graphical tool like HeidiSQL to match up the excel columns to the columns in your database.

- 1
- 1

- 45,724
- 13
- 98
- 148
You can use apache poi library to read the excel file line by line and jdbc to create connection to mysql database and execute insert statements.
In my project I used jruby with nurettin-jruby-poi fork of the jruby-poi gem to read the excel file and activerecord to insert the data into mysql.

- 11,090
- 5
- 65
- 85
- Write a .NET Program (Console is simpler)
- Access the Excel Worksheet/Workbook
- Copy the Attributes and create appropriate Tables for the sheets in your Excel
- Now copy the contents to SQL Tables appropriately
Since it is automated it will be faster

- 128
- 10
You can use a GUI Data Import tool, it supports direct import from *.XLS and *.XLSX (Excel 2007) files.

- 119,203
- 23
- 166
- 186
Use Talend Open Studio to visually design and then automate any kind of data integration job.

- 1,165
- 10
- 22
My favorite tool for converting excel sheets into mysql database... Full disclosure, I am the author.

- 7,578
- 13
- 55
- 96
creating a CSV is better. if we use CSV method we can export any character sets(unicode) also ones we create a CSV file then, just use LOAD method available in mySql. load method is used to import data to mysql directly(using sql query). LOAD local permit you to import data from any location in your local machine