0

A basic installation of MySQL creates, but does not populate, the several timezone-related tables in database "mysql".

To populate those tables, you might consult: https://dev.mysql.com/doc/mysql-g11n-excerpt/8.0/en/time-zone-support.html (or similar for version 5.7).

... where the following command is shown

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

However, this command fails. Solution in the answers below.

asked Apr 8, 2024 at 0:12

1 Answer 1

0

The command shown in the docs: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

is intended to produce, as output, a SQL script with separate steps for loading the various tables. On 5.7 (I don't know about 8.x) that script lacks any statement that selects the database "mysql". So you must add that in the command line: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -u root -p rootpwd

You can then check that the several time_zone related tables are populated.

answered Apr 8, 2024 at 0:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.