Open Source Tips : Networking,Linux/Unix,Programming,News,Howto..

  • Increase font size
  • Default font size
  • Decrease font size

How to convert a csv file into Mysql Database

E-mail Print PDF
Your Ad Here
User Rating: / 4
PoorBest 
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.



  Your Ad Here

Add comment


Security code
Refresh

AdBrite

Tag Cloud

_____ _Visitors Counter_ _____

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday:219
mod_vvisit_counterYesterday:378
mod_vvisit_counterThis week:1569
mod_vvisit_counterLast week:2530
mod_vvisit_counterThis month:3762
mod_vvisit_counterLast month:10280

Your IP: 38.107.191.82
Now is: 2010-03-11 14:07