[mythtv-users] DB Error (Insert Keybinding) in mythfrontend.log duplicate entry for key1

Michael T. Dean mtdean at thirdcontact.com
Sat Jul 8 15:18:59 UTC 2006


On 07/07/2006 09:29 AM, Bemer wrote:
> After my upgrade to mythtv 0.19 and mysql version 4 I get alot of errors in my mythfrontend.log. The errors occour after every reboot and I've tried to drop and import mythconverg without any success. I get an error for every entry in my table keybindings see example:
>
> DB Error (Insert Keybinding):
> Query was:
> INSERT INTO keybindings (context, action, description, keylist, hostname) VALUES 
> ( 'TV Playback', 'SPEEDDEC', 'Decrease the playback speed', 'J', 'HTPC' );
> Driver error was [2/1062]:
> QMYSQL3: Unable to execute query
> Database error was:
> Duplicate entry 'TV Playbac-SPEEDDEC-HTPC' for key 1
>
>
> I notice that the duplicate entry misses a character it says Tv Playbac instead of TV Playback. Does this have something to do with characterset? what are the default? is it utf8 or should I use latin1 and what collation should I use? I live in sweden.
>   

It's possible it's due to changing the character set.  MythTV 0.19 and 
above now include an "ALTER DATABASE mythconverg DEFAULT CHARACTER SET 
latin1;" (because many users installed MySQL 5 with UTF8, which changed 
character sets and broke things).  It's possible that yours was 
different before and things didn't go well on the change.

> What has gone wrong? and how do I correct this?

Go into mythcontrols and edit your bindings.  It should help you find 
the duplicate.  Also, just to ensure your database isn't corrupt, run 
optimize_mythdb.pl in the contrib directory before doing so (and then 
set it up to run in a daily cron job).

> What information will I loose if I recreate my mythconverg database

Only settings/configuration if you do it right (but there are enough new 
ones in 0.19 that it really makes sense to go back through them, anyway).

>  and how do I do that (or is it enough to run mc.sql and then do I mythsetup)?

http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.5
http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7

Back up your current database, drop the database, create a new database 
(with mc.sql), start mythtv-setup, exit mythtv-setup, do the work in 
"Moving your data to new hardware", and then go back to mythtv-setup and 
configure the backend, then start mythbackend, then start mythfrontend, 
go to the frontend settings, and configure mythfrontend.

Mike


More information about the mythtv-users mailing list