Cara Mengatasi Error MySQL: ERROR 1298 (HY000): Unknown or incorrect time zone: ‘UTC’

Pada mysql versi tertentu di mesin tertentu ketika anda melakukan query:

SET time_zone = 'UTC';

akan menghasilkan error seperti ini:

ERROR 1298 (HY000): Unknown or incorrect time zone: ‘UTC’

Untuk mengatasi hal itu, silakan lakukan langkah berikut:

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

dengan contoh hasil:

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.

Selamat mencoba!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: