Difference between revisions of "MySQL Time Zone Tables"
From MythTV Official Wiki
Uncle hammy (talk | contribs) |
(Added note for those withoue mysql root user passwords.) |
||
Line 53: | Line 53: | ||
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<yourpassword> mysql | mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<yourpassword> mysql | ||
</pre> | </pre> | ||
+ | |||
+ | Remove the <code>-p<yourpassword></code> from the above if you don't have one. | ||
Restart MySQL, and repeat the initial test. | Restart MySQL, and repeat the initial test. |
Revision as of 21:07, 13 August 2012
Starting with MythTV version 0.26, the time zone tables must be loaded in MySQL.
Distributions that don't have the time zone tables loaded:
Ubuntu 12.04 Mythbuntu 12.04 Mythbuntu 10.04 Fedora 16
Distributions that do have the timezone tables loaded:
Gentoo (confirmed for dev-db/mysql-5.1.61)
To see if the tables are already loaded, enter mysql and type:
SELECT CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York');
If the response looks like:
+--------------------------------------------------------------+ | CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York') | +--------------------------------------------------------------+ | 2012-06-07 08:00:00 | +--------------------------------------------------------------+
the tables are loaded and no further action is required.
If the response looks like:
+--------------------------------------------------------------+ | CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York') | +--------------------------------------------------------------+ | NULL | +--------------------------------------------------------------+
then the tables must be loaded.
Assuming the distribution's time zone information is in /usr/share/zoneinfo, type:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<yourpassword> mysql
Remove the -p<yourpassword>
from the above if you don't have one.
Restart MySQL, and repeat the initial test.
References: