4

I am trying to set up Django with MySQL on a Mac. This is my setup:

  • Django 1.9
  • Mysql 5.6.23
  • OS X 10.11

For the data communication, I use MySQL Connector.

I have modified the settings.py file, so that Django can talk to MySQL. The problem is when I do python manage.py migrate, I keep getting this error:

django.db.utils.DatabaseError: Incorrect datetime value:
'2016-01-11 06:59:07.980679+00:00' for column 'applied' at row 1.

What is wrong with this datetime format?

3 Answers 3

4

Please go to settings.py under your project directory and change USE_TZ to false

USE_TZ = False
0
1

Look at this bug report. Looks like this issue has been reported as a bug. Though I don't know what they mean by closed bug (invalid).

I have faced the same problem. I have switched to django 1.8.7, and it is working perfectly.

1
  • 2
    It was marked as invalid as it's a bug on the connector and it has to be reported to mysql rather than to Django.
    – arielnmz
    Commented Jun 10, 2016 at 18:36
0

Check this link, looks like the formatting is not correct for MySql

https://dba.stackexchange.com/questions/48704/mysql-5-6-datetime-incorrect-datetime-value-2013-08-25t1700000000-with-er

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.