[mythtv-users] mysql database problems, really need advice

ffrr ffrr at tpg.com.au
Sun Jul 24 04:10:52 EDT 2005

ffrr wrote:

> I think I damaged a table (mythconverg.recordedmarkup) trying to 
> import a .nuv file that had been exported using nuvexport.  It didn't 
> import completely, failing about line 6 in the script that nuvexport 
> wrote, but it did import well enough for me to be able to watch it.
> However, I noticed some errors with this table when a couple of new 
> shows were recorded.   I also noticed that pressing the 'e' key while 
> watching the new shows would not take me into edit mode.
> In the docs, it talks about mysqlcheck.  Running this did report that 
> the table was damaged.  I then ran it again, with the -r (repair) 
> option, again as per some docs.   It seemed to fix the table but had 
> issues later in the repair with mythconverg.smartplaylistcategory.    
> Also, something very bad happened at this point because running it 
> again started  giving errors that the tables were read only.  Running 
> mythtv, all data about tv guide, and recorded shows etc was missing.  
> More than a little worried :-(, I tried to shut down the mysqld 
> server, and restart it, but it could not be shutdown (according to 
> mandriva control centre).  I rebooted the whole box at this point, and 
> many messages about readonly file systems in the area of /var were 
> reported as it shut down.  On reboot, significant repairs were needed 
> to /dev/sda8 (which is where /var is mounted on my system).
> Ok, so, deep breath...  I log in and check mysqld.  It is running.  I 
> stop and restart it for good measure. All working.  I start 
> mythbackend, and then mythfrontend.   Luckily, all my data is back.  
> Good, so I start a show recording, and then go and watch it while 
> still recording.  All working, AND I can go into edit mode.
> So it's looking good. 
> Mysqlcheck still reports one problem
> mythconverg.smartplaylistcategory
> error    : File './mythconverg/smartplaylistcategory.MYD' not found 
> (Errcode: 2)
> (what is that?)
> Now, also, I want to back up my data at this point.  Being new to 
> myth, I haven't done this before, but the docs look straightforward 
> enough.  However, a small question.  Should ...
> mysqldump -u mythtv -pmythtv mythconverg -c > mythtv_backup.sql
> be run with the database up and running, but should I make sure myth 
> (front and backend) is NOT running when I do it?
> What else should I do?  Should I delete the database and recreate it, 
> or will it be OK now?  If I do recreate it, should I import the data 
> back in, or would that bring back corruption from the above incident?

An update.  I could not take a backup with mysqldump because of that 
error with smartplaylistcategory.MYD.  So I went snooping in the 
database directory.  I found a file with the name 
smartplaylistcategory.TMD, but no smartplaylistcategory.MYD.     OK, I 
thought, maybe TMD stands for temporary data, and maybe the repair 
program had put a copy of the datafile there, just in case. 

So, I renamed smartplaylistcategory.TMD to smartplaylistcategory.MYD  
and ran mysqlcheck.  All was OK.  So I ran mysqldump and now have a 4.3 
MB backup of the database.  Looking in the backup, it has valid data for 
smartplaylistcategory.MYD, so I am hoping all is fixed.  Yes?

More information about the mythtv-users mailing list