mysql_tzinfo_to_sql missing on my system

Posted by Sk1ppeR on Server Fault See other posts from Server Fault or by Sk1ppeR
Published on 2012-11-01T09:42:34Z Indexed on 2012/11/01 11:03 UTC
Read the original article Hit count: 593

Filed under:
|

I ran into problem with timezones within MySQL. Long story short, my application is worldwide, and each database has it's own timezone set within the application (not the server) in the way of "Europe/Berlin", "Europe/Vienna", "America/Sao Paulo". Obviously this is unacceptable for MySQL at first per connection. I read that it handles data better if you use UTC offsets.

Basically my goal is to log a field's alteration in another table using a trigger. For that I use UNIX_TIMESTAMP within the trigger. Although UNIX_TIMESTAMP() follows the global timezone for the server which obviously bothers me a lot :|

So I went to search for a "per connection" solution to use inside the trigger and well I found that mysql_tzinfo_to_sql can actually import zone info (UTC offsets) from my linux's zoneinfo files.

Although to my amuse, when I ran the commant I got the following:

bash: mysql_tzinfo_to_sql: command not found

So I'm looking for a solution to fix that. I don't want to "map" the timezone names into UTC offset just so I could use in the trigger.

Is there an alternative tool? Or at least sources for this one in particular only? What kind of queries does this tool generates so I could do it manually then if there is no alternative tool.

Thanks in advance on any help on the issue!

P.S: The OS is Debian GNU/Linux 6.0 and the MySQL server is the one from aptitude with performance tweaks with my.cnf

© Server Fault or respective owner

Related posts about mysql

Related posts about timezone