Difference between revisions of "Database errors"

From MythTV Official Wiki
Jump to: navigation, search
m (recordedseek table (up to 0.19))
m (Typos.)
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
  
 
If a table gets corrupted then usually you have to drop (delete) it
 
If a table gets corrupted then usually you have to drop (delete) it
an then create it anew. You should have basic knowledge of SQL
+
and then create it anew. You should have basic knowledge of SQL
 
to do this. The creation code for all tables is located in the
 
to do this. The creation code for all tables is located in the
 
mythtv source folder in the file libs/libmythtv/dbcheck.cpp .
 
mythtv source folder in the file libs/libmythtv/dbcheck.cpp .
Line 14: Line 14:
 
See [[Mysql]] for some pointers on fixing common problems with the database.
 
See [[Mysql]] for some pointers on fixing common problems with the database.
  
== recordedseek table (up to 0.19) ==
+
== [[recordedseek table]] (up to 0.19) ==
 
MythTV here stores seek marks for recorded shows and special marks
 
MythTV here stores seek marks for recorded shows and special marks
 
for the cutlist and commercial flagging. This table can grow quite large.
 
for the cutlist and commercial flagging. This table can grow quite large.
Line 28: Line 28:
 
You may also have run out of room in <code>/var</code>, check this using the <code>df</code> command.  If you need to make <code>/var</code> bigger, how you do this depends on the type of filesystem you are using (reiserfs. ext2, jfs, xfs etc).  You will need to look this up on the net.
 
You may also have run out of room in <code>/var</code>, check this using the <code>df</code> command.  If you need to make <code>/var</code> bigger, how you do this depends on the type of filesystem you are using (reiserfs. ext2, jfs, xfs etc).  You will need to look this up on the net.
  
* Log in or open up a terminal session as root superuser (or use <code>su -</code> )
+
# Log in or open up a terminal session as root superuser (or use <code>su -</code> )
* Stop mythbackend from running (on Ubuntu <code>/etc/init.d/mythbackend stop</code>)
+
# Stop mythbackend from running (on Ubuntu <code>/etc/init.d/mythbackend stop</code>)
* Change user to mythtv <code> su - mythtv</code>
+
# Change user to mythtv <code> su - mythtv</code>
* Run <code>mysqlcheck -r -umythtv -pmythtv mythconverg</code> (change the -pmythtv to have your own password folliowing -p)
+
# Run <code>mysqlcheck -r -umythtv -pmythtv mythconverg</code> (change the -pmythtv to have your own password following -p)
* Check for any reported errors- if there are you may have to rebuild the table in question (write down which one it is)
+
# Check for any reported errors- if there are you may have to rebuild the table in question (write down which one it is)
* Once all tables are OK, restart mythbackend (on Ubuntu <code>/etc/init.d/mythbackend start</code>)  
+
# Once all tables are OK, restart mythbackend (on Ubuntu <code>/etc/init.d/mythbackend start</code>)  
* Rebuild the time indexes in all programs, run <code>mythcommflag --rebuild --all</code> (note that this can take a long time)
+
# Rebuild the time indexes in all programs, run <code>mythcommflag --rebuild --all</code> (note that this can take a long time)
  
 
[[Category:Troubleshooting]]
 
[[Category:Troubleshooting]]
  
 
--[[User:Indulis|indulis]] 01:09, 25 January 2007 (UTC)IndulisBernsteins
 
--[[User:Indulis|indulis]] 01:09, 25 January 2007 (UTC)IndulisBernsteins

Latest revision as of 14:28, 6 February 2014

The MythTV system is built upon a MySQL database. If this database is corrupted then many things may go wrong. -- so backup the database often.

For now this is just a summary of things that may happen when single tables are corrupted/deleted. If you suspect a database error then you should look out for MySQL error messages like "Cannot open file table.MYI" in the logs of MythTV.

If a table gets corrupted then usually you have to drop (delete) it and then create it anew. You should have basic knowledge of SQL to do this. The creation code for all tables is located in the mythtv source folder in the file libs/libmythtv/dbcheck.cpp .

See Mysql for some pointers on fixing common problems with the database.

recordedseek table (up to 0.19)

MythTV here stores seek marks for recorded shows and special marks for the cutlist and commercial flagging. This table can grow quite large.

Corruption of this table leads to problems when seeking in recordings or when editing recordings:

  • fast forward/rewind works only erratically or very slowly,
  • editing does not work or is excruciatingly slow.

Some of these errors can be remedied by regenerating the seek table for all or a specific recording using mythcommflag --rebuild.

You may also have run out of room in /var, check this using the df command. If you need to make /var bigger, how you do this depends on the type of filesystem you are using (reiserfs. ext2, jfs, xfs etc). You will need to look this up on the net.

  1. Log in or open up a terminal session as root superuser (or use su - )
  2. Stop mythbackend from running (on Ubuntu /etc/init.d/mythbackend stop)
  3. Change user to mythtv su - mythtv
  4. Run mysqlcheck -r -umythtv -pmythtv mythconverg (change the -pmythtv to have your own password following -p)
  5. Check for any reported errors- if there are you may have to rebuild the table in question (write down which one it is)
  6. Once all tables are OK, restart mythbackend (on Ubuntu /etc/init.d/mythbackend start)
  7. Rebuild the time indexes in all programs, run mythcommflag --rebuild --all (note that this can take a long time)

--indulis 01:09, 25 January 2007 (UTC)IndulisBernsteins