Difference between revisions of "Database"

From MythTV Official Wiki
Jump to: navigation, search
m (Added note)
Line 1: Line 1:
= MythTV database =
+
MythTV uses a [http://www.mysql.com/ MySQL] [relational database] to manage almost all aspects of configuration and day-to-day operation. [[Mythfrontend]], [[mythbackend]], [[mythfilldatabase]], [[:Category:Plugins|MythTV plugins]] and ancillary programs all interact with the database and use it to store settings and information.
  
MythTV uses a [http://www.mysql.com/ MySQL] relational database to manage almost all aspects of configuration and day-to-day operation. [[Mythfrontend]], [[mythbackend]], [[mythfilldatabase]], [[:Category:Plugins|MythTV plugins]] and ancillary programs all interact with the database and use it to store settings and information.
+
By default, the database is named [[Database Schema|mythconverg]] and contains a set of [[:Category:DB Table|tables]] that interact with one-another. When running multiple frontends and/or backends, only one database is required.
  
By default, the database is named [[Database Schema|mythconverg]] and contains a set of [[:Category:DB Table|tables]] that interact with one-another.
+
==Database tables==
 +
In 0.26 there are 108 tables in the database. The incomplete schema below gives some information about what each table is for and some of the key fields.
  
Note that when running multiple frontends and/or backends, only one database is required.
+
Information on the 0.27 database schema generated by [http://en.wikipedia.org/wiki/Doxygen Doxygen] is available [http://code.mythtv.org/doxygen/group__db__schema.html here] on the MythTV code development site.
  
==Command line interface==
+
{|
 +
| align="center" style="background:#f0f0f0;"|'''Table name'''
 +
| align="center" style="background:#f0f0f0;"|'''Purpose'''
 +
| align="center" style="background:#f0f0f0;"|'''Fields'''
 +
| align="center" style="background:#f0f0f0;"|'''Key relationship fields'''
 +
| align="center" style="background:#f0f0f0;"|'''Other notable fields'''
 +
|-
 +
| [[archiveitems]]||||||||
 +
|-
 +
| [[callsignnetworkmap]]||||||||
 +
|-
 +
| [[capturecard]]||Attributes of capture card||26||cardid*,diseqid||videodevice,audiodevice,cardtype
 +
|-
 +
| [[cardinput]]||||||||
 +
|-
 +
| [[channel]]||||28||channelid*, freqid, sourceid, xmltvid, mplexid, iptvid||name, channelnum, icon, recpriority, contrast
 +
|-
 +
| [[channelgroup]]||||3||id*, chanid, grpid||
 +
|-
 +
| [[channelgroupnames]]||||2||grpid*||
 +
|-
 +
| [[channelscan]]||||5||scanid*,cardid,sourceid||processed, scandate
 +
|-
 +
| [[channelscan_channel]]||||38||transportid,scanid,mplex_id,source_id,service_id, xmltvid||freqid, service_name, chan_num
 +
|-
 +
| [[channelscan_dtv_multiplex]]||||||||
 +
|-
 +
| [[codecparams]]||||||||
 +
|-
 +
| [[credits]]||||||||
 +
|-
 +
| [[customexample]]||||||||
 +
|-
 +
| [[diseqc_config]]||||||||
 +
|-
 +
| [[diseqc_tree]]||||||||
 +
|-
 +
| [[displayprofilegroups]]||||||||
 +
|-
 +
| [[displayprofiles]]||||||||
 +
|-
 +
| [[dtv_multiplex]]||Information needed to tue to a particular frequency on a particular input||24||mplexid*,sourceid,transportid,networkid||frequency, polarity, modulation
 +
|-
 +
| [[dtv_privatetypes]]||Free form data pertaining to DVB services, it is like a settings table for DVB.||4||networkid||sitype,private_type,private_value
 +
|-
 +
| [[dvdbookmark]]||||||||
 +
|-
 +
| [[dvdinput]]||||||||
 +
|-
 +
| [[dvdtranscode]]||||||||
 +
|-
 +
| [[eit_cache]]||||||||
 +
|-
 +
| [[filemarkup]]||||||||
 +
|-
 +
| [[gallerymetadata]]||||||||
 +
|-
 +
| [[gamemetadata]]||||||||
 +
|-
 +
| [[gameplayers]]||||||||
 +
|-
 +
| [[housekeeping]]||||||||
 +
|-
 +
| [[inputgroup]]||||||||
 +
|-
 +
| [[internetcontent]]||||||||
 +
|-
 +
| [[internetcontentarticles]]||||||||
 +
|-
 +
| [[inuseprograms]]||||||||
 +
|-
 +
| [[iptv_channel]]||||||||
 +
|-
 +
| [[jobqueue]]||||||||
 +
|-
 +
| [[jumppoints]]||||||||
 +
|-
 +
| [[keybindings]]||||||||
 +
|-
 +
| [[keyword]]||||||||
 +
|-
 +
| [[livestream]]||||||||
 +
|-
 +
| [[logging]]||||||||
 +
|-
 +
| [[movies_movies]]||||||||
 +
|-
 +
| [[movies_showtimes]]||||||||
 +
|-
 +
| [[movies_theaters]]||||||||
 +
|-
 +
| [[music_albumart]]||||||||
 +
|-
 +
| [[music_albums]]||||||||
 +
|-
 +
| [[music_artists]]||||||||
 +
|-
 +
| [[music_directories]]||||||||
 +
|-
 +
| [[music_genres]]||||||||
 +
|-
 +
| [[music_playlists]]||||||||
 +
|-
 +
| [[music_smartplaylists]]||||||||
 +
|-
 +
| [[music_smartplaylist_categories]]||||||||
 +
|-
 +
| [[music_smartplaylist_items]]||||||||
 +
|-
 +
| [[music_songs]]||||||||
 +
|-
 +
| [[music_stats]]||||||||
 +
|-
 +
| [[mythlog]]||||||||
 +
|-
 +
| [[networkiconmap]]||||||||
 +
|-
 +
| [[newssites]]||||||||
 +
|-
 +
| [[oldfind]]||||||||
 +
|-
 +
| [[oldprogram]]||||||||
 +
|-
 +
| [[oldrecorded]]||||||||
 +
|-
 +
| [[people]]||||||||
 +
|-
 +
| [[phonecallhistory]]||||||||
 +
|-
 +
| [[phonedirectory]]||||||||
 +
|-
 +
| [[pidcache]]||||||||
 +
|-
 +
| [[playgroup]]||||||||
 +
|-
 +
| [[powerpriority]]||||||||
 +
|-
 +
| [[profilegroups]]||||||||
 +
|-
 +
| [[program]]||||||||
 +
|-
 +
| [[programgenres]]||||||||
 +
|-
 +
| [[programrating]]||||||||
 +
|-
 +
| [[recgrouppassword]]||||||||
 +
|-
 +
| [[record]]||||||||
 +
|-
 +
| [[recorded]]||||||||
 +
|-
 +
| [[recordedartwork]]||||||||
 +
|-
 +
| [[recordedcredits]]||||||||
 +
|-
 +
| [[recordedfile]]||||||||
 +
|-
 +
| [[recordedmarkup]]||||||||
 +
|-
 +
| [[recordedprogram]]||||||||
 +
|-
 +
| [[recordedrating]]||||||||
 +
|-
 +
| [[recordedseek]]||||||||
 +
|-
 +
| [[recordfilter]]||||||||
 +
|-
 +
| [[recordingprofiles]]||||||||
 +
|-
 +
| [[recordmatch]]||||||||
 +
|-
 +
| [[romdb]]||||||||
 +
|-
 +
| [[scannerfile]]||||||||
 +
|-
 +
| [[scannerpath]]||||||||
 +
|-
 +
| [[schemalock]]||||||||
 +
|-
 +
| [[settings]]||||||||
 +
|-
 +
| [[storagegroup]]||||||||
 +
|-
 +
| [[tvchain]]||||||||
 +
|-
 +
| [[tvosdmenu]]||||||||
 +
|-
 +
| [[upnpmedia]]||||||||
 +
|-
 +
| [[videocast]]||||||||
 +
|-
 +
| [[videocategory]]||||||||
 +
|-
 +
| [[videocollection]]||||||||
 +
|-
 +
| [[videocountry]]||||||||
 +
|-
 +
| [[videogenre]]||||||||
 +
|-
 +
| [[videometadata]]||||||||
 +
|-
 +
| [[videometadatacast]]||||||||
 +
|-
 +
| [[videometadatacountry]]||||||||
 +
|-
 +
| [[videometadatagenre]]||||||||
 +
|-
 +
| [[videopart]]||||||||
 +
|-
 +
| [[videopathinfo]]||||||||
 +
|-
 +
| [[videosource]]||This table tells us about a particular input on a video capture card.||||||
 +
|-
 +
| [[videotypes]]||||||||
 +
|-
 +
| [[weatherdatalayout]]||||||||
 +
|-
 +
| [[weatherscreens]]||||||||
 +
|-
 +
| [[weathersourcesettings]]||||||||
 +
|-
 +
| [[websites]]||||||||
 +
|-
 +
|
 +
|}
  
Use the mysql command on the host running the database:
+
==Command line interface==
 +
Use the <code>mysql</code> command on the host running the database:
  
 
  % mysql -u mythtv -pmythtv mythconverg
 
  % mysql -u mythtv -pmythtv mythconverg
Line 15: Line 241:
 
SQL commands can be issued at the '''mysql>''' prompt.
 
SQL commands can be issued at the '''mysql>''' prompt.
  
==Web Interface==
+
==Graphical interface==
  
Try installing [http://www.phpmyadmin.net phpMyAdmin].
+
Try installing [http://www.phpmyadmin.net phpMyAdmin], which can administrate MySQL databases via a browser.
  
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Revision as of 11:25, 14 February 2013

MythTV uses a MySQL [relational database] to manage almost all aspects of configuration and day-to-day operation. Mythfrontend, mythbackend, mythfilldatabase, MythTV plugins and ancillary programs all interact with the database and use it to store settings and information.

By default, the database is named mythconverg and contains a set of tables that interact with one-another. When running multiple frontends and/or backends, only one database is required.

Database tables

In 0.26 there are 108 tables in the database. The incomplete schema below gives some information about what each table is for and some of the key fields.

Information on the 0.27 database schema generated by Doxygen is available here on the MythTV code development site.

Table name Purpose Fields Key relationship fields Other notable fields
archiveitems
callsignnetworkmap
capturecard Attributes of capture card 26 cardid*,diseqid videodevice,audiodevice,cardtype
cardinput
channel 28 channelid*, freqid, sourceid, xmltvid, mplexid, iptvid name, channelnum, icon, recpriority, contrast
channelgroup 3 id*, chanid, grpid
channelgroupnames 2 grpid*
channelscan 5 scanid*,cardid,sourceid processed, scandate
channelscan_channel 38 transportid,scanid,mplex_id,source_id,service_id, xmltvid freqid, service_name, chan_num
channelscan_dtv_multiplex
codecparams
credits
customexample
diseqc_config
diseqc_tree
displayprofilegroups
displayprofiles
dtv_multiplex Information needed to tue to a particular frequency on a particular input 24 mplexid*,sourceid,transportid,networkid frequency, polarity, modulation
dtv_privatetypes Free form data pertaining to DVB services, it is like a settings table for DVB. 4 networkid sitype,private_type,private_value
dvdbookmark
dvdinput
dvdtranscode
eit_cache
filemarkup
gallerymetadata
gamemetadata
gameplayers
housekeeping
inputgroup
internetcontent
internetcontentarticles
inuseprograms
iptv_channel
jobqueue
jumppoints
keybindings
keyword
livestream
logging
movies_movies
movies_showtimes
movies_theaters
music_albumart
music_albums
music_artists
music_directories
music_genres
music_playlists
music_smartplaylists
music_smartplaylist_categories
music_smartplaylist_items
music_songs
music_stats
mythlog
networkiconmap
newssites
oldfind
oldprogram
oldrecorded
people
phonecallhistory
phonedirectory
pidcache
playgroup
powerpriority
profilegroups
program
programgenres
programrating
recgrouppassword
record
recorded
recordedartwork
recordedcredits
recordedfile
recordedmarkup
recordedprogram
recordedrating
recordedseek
recordfilter
recordingprofiles
recordmatch
romdb
scannerfile
scannerpath
schemalock
settings
storagegroup
tvchain
tvosdmenu
upnpmedia
videocast
videocategory
videocollection
videocountry
videogenre
videometadata
videometadatacast
videometadatacountry
videometadatagenre
videopart
videopathinfo
videosource This table tells us about a particular input on a video capture card.
videotypes
weatherdatalayout
weatherscreens
weathersourcesettings
websites

Command line interface

Use the mysql command on the host running the database:

% mysql -u mythtv -pmythtv mythconverg

SQL commands can be issued at the mysql> prompt.

Graphical interface

Try installing phpMyAdmin, which can administrate MySQL databases via a browser.