cancel
Showing results for 
Search instead for 
Did you mean: 

importing local CSV file into mySQL - how is it done?

N/A

importing local CSV file into mySQL - how is it done?

I'm a novice with mySQL - well databases in general... could anyone explain the basic process of creating a table in my mySQL database using a CSV file which currently resides on my local machine?? Is this is even possible? - i can only find documentation for EXPORTING to a CSV file.
Cheers
Nick
3 REPLIES
N/A

importing local CSV file into mySQL - how is it done?

Hi, I have fould the following link which will turn your csv file into lovely SQL code for creating a table. The table will created (if it does not already exist) and will be called the name of the csv file (without the .csv of course). The field/column names will be that of your first line of csvs.

http://www.sqldbu.com/eng/sections/tips/mysqlimport.html

When you click go it will prompt you to download a txt file. You are supposed to run the text file into the 'import files' tab of the 'query window' (bottom left of phpMyAdmin), however this doesnt seem to work for me. Instead, copy the contents of the text file into the text box on the 'SQL' tab of the query window, and this seems to work fine for me.

Let me know if it works for you, zambesi.

Anyone else had problems uploading files as files?

Jarv
N/A

importing local CSV file into mySQL - how is it done?

Thanks Jarvis.. followed your instructions and it worked a treat Smiley
Nick
N/A

importing local CSV file into mySQL - how is it done?

nice one, happy to help.