[mythtv-users] Error upgrading DB scheme from .20.2 to 21

Mike Holden mythtv at mikeholden.org
Tue May 20 21:03:42 UTC 2008


Brent Norris wrote:
> When mythbackend attempts to upgrade the DB on my friends mythtv install
>   it fails with the following error:
>
> 2008-05-20 15:18:04.443 DB Error (Performing database upgrade):
> Query was: INSERT storagegroup (groupname, hostname, dirname)     SELECT
> DISTINCT 'Default', hostname, data     FROM settings     WHERE value =
> 'RecordFilePrefix'         AND hostname IS NOT NULL         AND hostname
> <> '';
> Error was: Driver error was [2/1062]:
> QMYSQL3: Unable to execute query
> Database error was:
> Duplicate entry 'Default-mythback-/storage' for key 2
>
> new version: 1171
> 2008-05-20 15:18:04.445 Database Schema upgrade FAILED, unlocking.
> 2008-05-20 15:18:04.446 Couldn't upgrade database to new schema
>
>
> Logging into mysql and running the query results in:
>
> mysql> select DISTINCT  'Default', 'mythback', '/storage' from settings;
> +---------+----------+----------+
> | Default | mythback | /storage |
> +---------+----------+----------+
> | Default | mythback | /storage |
> +---------+----------+----------+
> 1 row in set (0.00 sec)
>
> It looks to me like this duplicate entry is the problem, what do i need
> to do to get rid of it, so that the upgrade can complete?
>
> Thanks
>
> Brent
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

Sorry, but that query doesn't prove anything. All you're asking it do do
is output those 3 literal strings to the screen, not actually pull any
data from the table at all:

mysql> select DISTINCT  'tom', 'dick', 'harry' from settings;
+-----+------+-------+
| tom | dick | harry |
+-----+------+-------+
| tom | dick | harry |
+-----+------+-------+

What you should be running is tthe query you posted earlier, which is:

SELECT DISTINCT 'Default', hostname, data     FROM settings     WHERE
value = 'RecordFilePrefix'         AND hostname IS NOT NULL         AND
hostname <> '';

mysql> SELECT DISTINCT 'Default', hostname, data     FROM settings    
WHERE value = 'RecordFilePrefix'         AND hostname IS NOT NULL        
AND hostname <> '';
+---------+-------------+----------------------------+
| Default | hostname    | data                       |
+---------+-------------+----------------------------+
| Default | OLDHOSTNAME | /var/lib/mythtv/recordings |
+---------+-------------+----------------------------+

-- 
Mike Holden

http://www.by-ang.com - the place to shop for all manner of hand crafted
items, including Jewellery, Greetings Cards and Gifts





More information about the mythtv-users mailing list