Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Insert zoneinfo into MySQL on install

Tudor Holton shared this idea 8 years ago
Open Discussion

I just ran into an interesting problem on a new CPanel server.


  1. 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:

  1. mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

or

  1. 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?

Leave a Comment
 
Attach a file