[mythtvnz] Channel id to name tables: Where are they?

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Oct 22 01:58:42 BST 2012


On Mon, 22 Oct 2012 12:30:45 +1300, you wrote:

>Friends
>
>A while ago I asked for help here with a problem where some times the
>wrong channel is recorded at the correct time.
>
>I have an example that has made me wonder if my channel table in the
>database is a bit skew-whiff.
>
>How do I query my database to get a channel ID to english language
>description?  I am wondering if in all my updating channels I corrupted
>those tables.

This is the script I use to get a MySQL prompt in the mythconverg
database:

#!/bin/bash

# Run MySQL to access the mythconverg database.

source /etc/mythtv/mysql.txt
mysql -u $DBUserName -p$DBPassword -h $DBHostName $DBName


The script will not work in 0.26, as the mysql.txt file has been
removed - I am working on a new version to get the login data from the
new format config.xml file.  After you get the "mysql> " prompt, use
this command:

select chanid,channum,callsign,name,xmltvid from channel order by
channum+0;

Note that channum is a character field - the "+0" converts it to
numeric to make it sort correctly.

>A question for an FAQ (if one eventuates) is "Where can I see a
>structure of the MythTV DBs?"  Answering that would be sufficient for me.

The magic words to search for this are "mythtv database schema".
Unfortunately, database does change with MythTV versions, and the
documentation is rarely up to date.  You can find it here:

http://www.mythtv.org/wiki/Database_Schema

When I checked today, my DBSchemaVer ("select * from settings where
value='DBSchemaVer';") was 1299 (0.25+fixes), but the documentation is
for 1263.  But I usually find enough information there to be able to
find my way around the actual database using "show tables;" and
"describe <tablename>;".

>cheers
>Worik
>
>
>PS:  The long story is looking at the backend logs I see a recording of
>BBC news that was broadcast on TV1 at 4am but recorded Maori TV...
>
>2012-10-22 04:00:03.264 Started recording: "BBC World News": channel
>1052 on cardid 1, sourceid 1
>
>TV1 recordings are on channel 1001 and Maori TV on 1005.



More information about the mythtvnz mailing list