How to import an Excel file in a MySQL database in PHPMyAdmin
It is sometimes easier to work on some data in Excel, before importing in a MySQL database.
In order to do so, here are a few simple steps.
In short : export the Excel file to CSV, and import the CSV in a new table using the PHPMyAdmin interface.
Starting with an Excel, in below example one sheet containing some data
Select Save As to be able to select another format
Scroll down to the CSV (Comma delimited) (*.csv) format
Confirm that some features will be lost – CSV being a text format, no Excel specifics will be exported (functions, programs, …)
In PHPMyAdmin, go to the Import menu
Browse for the CSV file recently saved, and select the appropriate format
Look for other options that might apply, for example, if columns have names, check the corresponding option “The first line of the file contains the table column names“, and click Go
Import confirmation should be displayed, and links to the resulting database and table will be shown
It is now possible to browse through the table !
Using the diverse options, it is also possible to work on the table structure, content, or to move it to another database