ERROR 1298 (HY000): Unknown or incorrect time zone: ‘US/Eastern’

Error: Error occurred during setting time zone with name


mysql> SET GLOBAL time_zone = 'US/Eastern';
ERROR 1298 (HY000): Unknown or incorrect time zone: 'US/Eastern'

Solution:

  1. Check the table mysql.time_zone_name.
mysql> SELECT COUNT(*) FROM mysql.time_zone_name;
+----------+
| COUNT(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 s

2. Download the time zone table:
https://dev.mysql.com/downloads/timezones.html

3. Insert or load the download file into mysql database with following command.

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p mysql < C:\d\timezone_posix.sql
Enter password: *********
C:\Program Files\MySQL\MySQL Server 8.0\bin>

4. Now Test again

mysql> SELECT COUNT(*) FROM mysql.time_zone_name;
+----------+
| COUNT(*) |
+----------+
|      594 |
+----------+
1 row in set (0.01 sec)

mysql> SET GLOBAL time_zone = 'US/Eastern';
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| US/Eastern         | +00:00              |
+--------------------+---------------------+
1 row in set (0.00 sec)

1 thought on “ERROR 1298 (HY000): Unknown or incorrect time zone: ‘US/Eastern’

  1. Pingback: Check Time zone in MySQL | Smart way of Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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