0

I am working on a MySQL 5.7.41-44 instance running on a CentOS server.

The Linux timezone (per timedatectl) is America/Curacao (AST, -0400).

The MySQL @@system_time_zone returns AST (and not America/Curacao).

The problem is that AST is not defined in the OS's zoneinfo files nor in MySQL's timezone tables, but 'America/Curacao` is.

Because MySQLs @@system_time_zone returns a timezone which isn't in the timezone tables, functions like CONVERT_TZ([somedatetime], [fromTimeZone], @@system_time_zone) do not work.

As far as I can tell, nothing timezone-related is being explicitly set in the MySQL config (and nothing specified in the startup command), so I am under the assumption that it is pulling @@system_time_zone from the OS.

Assuming that the host OS server's timezone can't be changed, how can I resolve this?

I guess either I need AST in the timezone tables in a best-practice way, OR, force mySQL to pick up the Olson timezone version (America/Curacao in this case), but I am unsure how to achieve that.

2
  • Have you tried default-time-zone='America/Curacao' in the [mysqld] section in my.cnf ? Jun 5 at 20:00
  • Yes, that's the back-pocket solution I've had in mind, I am just trying to understand better how it all works when not explicitly set at the MySQL level.
    – GWR
    Jun 6 at 12:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.