Update MySQL Server Time Zone Data

I started to get the error message Database returned an invalid value in QuerySet.dates(). Are time zone definitions and pytz installed? from a Django application. These messages presented when I started to utilize date_hierarchy.

From the MySQL server run the following command

mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root -p mysql

This will parse the zone info directory and send the SQL output to the mysql command, which will update the time zone information on the server. Once this was done, I could proper utilize the date hierarchy features of Django admin.

Nov 11th, 2016 • Posted in Databases, Django, Linux, MySQL, Python
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>