1

I have a table in csv file and I want to import it into a MySQL table. I copy paste a series of data from a website into an excel file and then convert it to csv file.

The columns in my table are like:

Date,name,version,link

the format of the date is like dd/mm/yy

primarily I tried to load the file into mySQL table but I got this error code 1292:

Incorrect date value while the date value is set as DATE

I have also tried to put the CSV table to MySQL with python but still have the same error:

_mysql_exceptions.OperationalError: (1292, "Incorrect date value: 'Date' for column 'Date' at row 1")

Do anyone has any idea what should I do?

UserYmY
  • 8,034
  • 17
  • 57
  • 71
  • You'll probably have to translate the dates from `dd/mm/yy` to `yyyy-mm-dd`. – Aya May 22 '13 at 12:37
  • [This](http://stackoverflow.com/q/2238611/1205368) should help. – Salem May 22 '13 at 12:38
  • "primarily I tried to load the file into mySQL table" HOW? "Does anyone have any idea what should I do?" Yes. Provide us with relevant information. – glglgl May 22 '13 at 12:52

3 Answers3

0

yyyy/mm/dd and yyyy-mm-dd both formats will work

0

Since your format is dd/mm/yy so its giving error. It should be like yy/mm/dd or yymmdd or yyyymmdd or yy-mm-dd or may other ways.

so change it from dd/mm/yy to yy/mm/dd

Read more here

Yogus
  • 2,307
  • 5
  • 20
  • 38
0

I scrape a table from a web page and paste it into Excel. Then I save the Excel as csv format. However, Excel csv format contains Unicode characters because the table I scrape has them. So be sure to handle the Unicode before trying to put into your database.

Marichyasana
  • 2,966
  • 1
  • 19
  • 20