HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMajor

How do I resolve this error, "ERROR 1298 (HY000): Unknown or incorrect time zone: 'UTC'"?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
thiserrorincorrectzoneunknownutctimehy000resolvehow

Problem

When I run the following command I get an error, however one of my scripts requires it.

SET time_zone = 'UTC';
ERROR 1298 (HY000): Unknown or incorrect time zone: 'UTC'

Solution

Simply run mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p


$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
Enter password: 
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.


Trivia: If you want to know what the HY00 stands for (a follow up I asked years later)....

Code Snippets

$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
Enter password: 
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.

Context

StackExchange Database Administrators Q#120945, answer score: 37

Revisions (0)

No revisions yet.