views:

26

answers:

2

Hi,

I have lot of excel files to import in mysql table.

Is there any mysql command/procedure which directly takes excel file and import it in table one by one?

or any simpler way to to this task in few steps?

+2  A: 

MySQL can't read Excel files directly.

Either convert the Excel files to CSV, or write a script that reads the Excel files (using the appropriate excel-reader libraries for your language of choice) and inserts that data into MySQL.

There are a few programs available that will allow you to batch convert files from Excel to CSV (e.g this one from SoftInterface, which was the first result returned by a Google search on "Excel to CSV")

Mark Baker
A: 

If you're doing this all a Windows box, you could set up the Excel files as ODBC databases and use Access or similar to copy all the data over to MySQL via its own ODBC connector, but then you're stuck having to set up a DSN for each excel file, or manually cutting/pasting the data into a single ODBC's .xls from each other .xls.

Marc B