Importing CSV files with phpMyAdmin

Nerding on January 8th, 2010 No Comments

phpMyAdmin, a handy MySQL administration tool, has a feature allowing you to import data into your database as a CSV file.  I had some difficulties with it, so this short post just outlines what I found out.

The main trick has to do with column names.  If you select either the “CSV” or “CSV Load Data” options, you get a Column Names field to fill in, but it doesn’t tell you how.  I didn’t find how in the documentation either.  I guessed at using comma separated column names, which was close.  Turns out you can’t have “quotes”,”around”,”the”,”column”,”names”.  So you have to do,it,like,this,instead.

A secondary trick is that it appears not to handle quote-escaped quotes like “Ehren “”Loves CSVs”" Foss”.  You need to replace those with \”slash escaped\” quotes instead.

Tags:

No Responses to “Importing CSV files with phpMyAdmin”

Leave a Reply