Difference between revisions of "MySQL Time Zone Tables"

From MythTV Official Wiki
Jump to: navigation, search
(0.26 MySQL Requirement, based on -dev and -commit lists info from Mike Dean, tested on ubuntu 12.04)
 
(People loading packages *shouldn't* need to worry. Removed list of distributions.)
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:MySQL]]
+
[[Category:MySQL]] [[Category:Troubleshooting]]
 
Starting with MythTV version 0.26, the time zone tables must be loaded
 
Starting with MythTV version 0.26, the time zone tables must be loaded
in MySQL.
+
in MySQL. This should be done '''before''' attempting the upgrade. ''mythtv-setup''
 +
and ''mythbackend'' will not start without the tables loaded and an error
 +
message will apppear in the respective log explaining that.
  
Distributions that '''don't''' have the time zone tables loaded (please update or change
+
This is important for users building from source, users loading MythTV from a package,
this list to distributions that '''do''' have the tables loaded):
+
for example Mythbuntu, should expect the tables to be loaded automatically.
<pre>
 
Ubuntu 12.04
 
Mythbuntu 10.04
 
</pre>
 
  
 
To see if the tables are already loaded, enter mysql and type:
 
To see if the tables are already loaded, enter mysql and type:
Line 26: Line 24:
 
</pre>
 
</pre>
 
the tables are loaded and no further action is required.
 
the tables are loaded and no further action is required.
 
 
{{Note box|If the time zone tables are updated, then the
 
{{Note box|If the time zone tables are updated, then the
 
procedure below should be repeated.}}
 
procedure below should be repeated.}}
  
 
If the response looks like:
 
If the response looks like:
 
 
<pre>
 
<pre>
 
+--------------------------------------------------------------+
 
+--------------------------------------------------------------+
Line 47: Line 43:
 
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:19, 7 October 2012

Starting with MythTV version 0.26, the time zone tables must be loaded in MySQL. This should be done before attempting the upgrade. mythtv-setup and mythbackend will not start without the tables loaded and an error message will apppear in the respective log explaining that.

This is important for users building from source, users loading MythTV from a package, for example Mythbuntu, should expect the tables to be loaded automatically.

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.

Important.png Note: If the time zone tables are updated, then the procedure below should be repeated.

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: