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.
1 Answer 1
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.