6

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: http://www.iana.org/time-zones

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! :)

1 Answer 1

12

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.

1
  • Given that the link above is dead - here's the command that you run in a typical Centos/Rocky setup after updating the tzdata (as correctly shown above): mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql Then to take effect you'll need restart the mariadb service
    – Reece
    May 18, 2022 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .