[mythtv-users] Where is the Search Descriptions Database?

Bruce Markey bjm at lvcm.com
Sun Mar 20 17:09:25 UTC 2005


Jeff "Muddy" Waters wrote:
> Hi all, 
> 
> I'm running 0.15 on gentoo and for some reason a long time ago it
> stopped letting me add search words to the TV -> schedule -> Search

Huh?

> Listings -> Descriptions list so I was wondering where in the database
> do it find it? I figured I can just add them manually, with webmin it's
> no big deal.
> 
> I tried looking in a few areas thus far but can't seem to pinpoint where
> the search keywords I added before are located in the database.

mythconverg.keyword but that's not the root question. How/why
did it stop working? Frist, backup your database as is:

http://www.mythtv.org/docs/mythtv-HOWTO-21.html#ss21.5

Run "mysqlcheck -r -u mythtv -pmythtv mythconverg". You should see:

...
mythconverg.keybindings                            OK
mythconverg.keyword                                OK
mythconverg.musicmetadata                          OK
...

Next, there was an update a while back. If that succeeded, the table
should be:

$ mysql -u mythtv -pmythtv -hnordtv mythconverg
mysql> describe keyword;
+------------+------------------+------+-----+---------+-------+
| Field      | Type             | Null | Key | Default | Extra |
+------------+------------------+------+-----+---------+-------+
| phrase     | varchar(128)     |      | PRI |         |       |
| searchtype | int(10) unsigned |      | PRI | 3       |       |
+------------+------------------+------+-----+---------+-------+
2 rows in set (0.02 sec)

If there isn't a "searchtype" column then 1049 may not have succeeded
and you may be able to fix it with:

ALTER TABLE keyword ADD COLUMN searchtype INT UNSIGNED NOT NULL DEFAULT 3;
ALTER TABLE keyword DROP INDEX phrase;
ALTER TABLE keyword DROP PRIMARY KEY;
ALTER TABLE keyword ADD UNIQUE(phrase,searchtype);

However, if this update did not succeed, then others around it may
have failed too and there may be other badness in your DB.

Alternatively, after you know you have a good backup, you could:

DROP TABLE keyword;
CREATE TABLE keyword (
phrase varchar(128) NOT NULL default '',
searchtype int(10) unsigned NOT NULL default '3',
UNIQUE KEY phrase (phrase,searchtype));

You could try to grep "INTO.*keyword" on your backup file to restore
your existing keywords or just start fresh.

$ grep "INTO.*keyword" mythtv_backup.sql > foo.sql
[examine and/or edit foo.sql]
$ mysql -u mythtv -pmythtv mythconverg < foo.sql

--  bjm


More information about the mythtv-users mailing list