Insert zoneinfo into MySQL on install
Open Discussion
I just ran into an interesting problem on a new CPanel server.
- CONVERT_TZ(NOW(),'UTC',$timezone)
returns NULL.
This is a small "feature" in MySQL as described here: http://dev.mysql.com/doc/refman/5.7/en/mysql-tzinfo-to-sql.html.
By default MySQL's timezone data is blank on new installs. To get the zoneinfo into MySQL, we have to run:
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
or
- mysql_tzinfo_to_sql --leap /usr/share/zoneinfo | mysql -u root mysql (to include leap second information)
Can we please include this as part of the installation?
Replies have been locked on this page!