cPanel & WHM Version 108 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Insert zoneinfo into MySQL on install

Tudor Holton shared this idea 7 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:

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


  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