How to update/install zoneinfo timezone database on CentOS?

user2044774 asked:

I’m trying to update my timezone database, on CentOS, the database located at /usr/share/zoneinfo.

I downloaded the time zone data from IANA here:

I tried editing the ‘make’ file and executing that, but got several errors so I’m not sure that was the right thing to do. I also tried just replacing my zoneinfo folder with this new data, and got the error that my timezone database was corrupt.

Am I missing something obvious, or am I missing instructions somewhere on how to do this? Would someone tell me how to install this?

(I’m trying to do this because mysql is giving me errors like this: ‘error: SET time_zone = ‘US/Pacific’ Unknown or incorrect time zone: ‘US/Pacific’).

Thank you! 🙂

My answer:

Don’t update the zoneinfo database manually. Just install the updates which are already provided for you by EL/CentOS in the tzdata package:

# yum update tzdata

Also note that MySQL keeps its own internal time zone tables, separate from the system timezone database. To update MySQL’s internal time zone tables, run the mysql_tzinfo_to_sql script which came with MySQL.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.