0

MariaDB run in docker container hangs during initial startup while mysql_tzinfo_to_sql running because of the issue.

I've disabled mysql_tzinfo_to_sql by setting MYSQL_INITDB_SKIP_TZINFO env. var to 1.

Afterwards i manually ran:

mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | mysql -uuser -ppass --database=mysql

It takes ~12 minutes and script causes errors in MariaDB error log if MariaDB cluster is set.

I'm wondering what's the purpose of running mysql_tzinfo_to_sql during MariaDB installation and consequences of disabling it.

Found this link:

MySQL provides developers with a rich set of Date and Time functions. One of the functions is CONVERT_TZ which converts a datetime value from one time zone to another. This function can use named time zones such as 'MET' or 'Europe/Moscow' from the time zone information tables in system database called mysql.

Named time zones can be used only if the time zone information tables in the mysql system database have been created and populated. The MySQL installation procedure creates the time zone tables in the mysql database, but does not load them with data. You need to load data manually for these time zone tables.

It does answer the question.

However, i still don't fully understand practical implications of disabling populating mysql timezone system tables.

Why does timezone system tables population may take so long during initial MariaDB startup ?

1

Manual is pretty clear: loaded TZs enables a TZ-related functions. Say, with TZs loaded you can transform result's datetimes due to the client's TZ automatically, or calculate FROM_UNIXTIME() with respect to the leap seconds or daysaving times etc.

  • and without loaded TZs, application has to do what you mentioned in its code? – rok Dec 17 '19 at 16:57
  • @rok Yep, otherwise you have to do all the calculations on the app's side. – Kondybas Dec 20 '19 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.