Search

How to convert a csv file into Mysql Database PDF Print E-mail
User Rating: / 5
PoorBest 
How to ? - General
Saturday, 14 November 2009 08:40
Article Index
How to convert a csv file into Mysql Database
How to convert csv file into Mysql Database
All Pages

 

You have one approach to uploading CSV file data into a MySQL database. You use the LOAD statement. There two caveats about using the LOAD command, and they are:

 

  • You must convert dates to the default MySQL format – YYYYMMDD, or the four digit year, two digit month, and two digit day.
  • You can’t use AUTO_INCREMENT from the source to the loading table.

It’s untrue that you must input dates as strings and convert them in the database. However, you can do that if you like. I’d suggest you open the file in Microsoft Excel, then create a column with the correct data format. You can do that by creating a custom format, or with a formula. I figure the custom format is easiest but sometimes a formula is necessary for applications.



Last Updated on Saturday, 14 November 2009 08:53
 

Add comment


Security code
Refresh

We have 96 guests online