Search code examples
sqlmysqlload-data-infile

Importing excel data in to mysql table using command line


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?


Solution

  • 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")