How to convert a csv file into Mysql Database PDF Print E-mail
User Rating: / 5
PoorBest 
How to ? - General
Written by Joby Joseph   
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

Follow us

  • Digg: opensourcetips
  • Facebook: profile.php?id=100001312990842
  • Facebook Page: 136837466337618
  • Twitter: opensourcetips

Blogroll




Visitors Counter

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday:317
mod_vvisit_counterYesterday:413
mod_vvisit_counterThis week:2765
mod_vvisit_counterLast week:3709
mod_vvisit_counterThis month:1157
mod_vvisit_counterLast month:7162

Your IP: 38.107.191.116
Now is: 2010-09-03 15:48

Tag Cloud

Facebook Like Button