PHPMyAdmin: Import data using CSV file

In our previous post, we have created table and inserted a record using the statement below:

INSERT INTO `album`(`Name`, `Title`, `Year`) VALUES ('Rod Stewart','Every Picture Tells A Story',1969)

This is a 3 column table and it is ok to use an sql statement if we need only to insert a few records.

Say we have  1000 records and they are all in a file.  We would have to import them by using PHPMyAdmin.

I used to work with Sybase or Oracle and normally, I would import them using bcp or bulk copy through the command line.

p10

 

To import them using PHPMyAdmin, you can prepare a CSV file using MS Excel.  This can be done easily by saving the file as CSV file in MS Excel.

In the PHPMyAdmin, as shown in the screenshot above, click on Choose File and select the CSV file.

p11

In the format of the file, we need to select CSV and click on GO.

The 3 records will be appended into the album table.

p12

 

Series Navigation<< PHPMyAdmin: Creating Table Using The UI