View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 23 posts ] 
Go to page Previous  1, 2

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Wed Dec 12, 2007 7:30 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Successfully completing the steps described above will ensure that the DB tables are self consistent, but not that they contain all the necessary data for your recordings. The following thread contains directions for other things you may to do to complete the recovery after doing DB repairs. http://mysettopbox.tv/phpBB2/viewtopic.php?t=14002&highlight=mythcommflag


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 04, 2008 8:57 am 
Offline
Joined: Wed Dec 21, 2005 1:14 pm
Posts: 145
Location: Charlotte NC USA
I had a problem last night with my program table that I was not able to correct with the normal methods but, came up with another solution and wanted to share it incase anyone has a similar problem.

Symptoms of the problem;
mythfrontend works fine but there is no guide data/ show listings/ channel info.
if you try to look at the mythconverg database through webmin it will tell you the program table is corrupt.


Results from an attempt to repair the table;
When trying all the different methods of repair the result with an error 5

If I shutdown the mysql and tried to copy the tables file program.MYI it would return an error because the file was corrupt..... This is when I new I was in trouble.

How I fixed the table

Code:
#su
#mysql
mysql> TRUNCATE TABLE program;
mysql>exit
#mythfilldatabase


After mythfilldatabase completed all was good.

This method only works on a table that can be repopulated and where the data file is corrupt but the table schema is in tact.

The truncate table command deletes all the data in the table but leave the table structure in tact.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 24, 2008 1:32 am 
Offline
Joined: Fri Jul 29, 2005 1:22 am
Posts: 232
Location: SF East Bay, CA
yet another system crash, and more filesystem fixes..

this time, mysql won't start, and I get

Quote:
/var/log/syslog
mysqld_safe[3918]: started
mysqld[3921]: 080223 23:07:40 InnoDB: Started; log sequence number 0 43665
mysqld[3921]: 080223 23:07:40 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/host.frm'
mysqld[3921]: 080223 23:07:40 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/host.frm'
mysqld[3921]: 080223 23:07:40 [ERROR] Fatal error: Can't open and lock privilege tables:
Incorrect information in file: './mysql/host.frm'
mysqld_safe[3932]: ended

/etc/init.d/mysql[4067]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping'
resulted in
/etc/init.d/mysql[4067]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
/etc/init.d/mysql[4067]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
/etc/init.d/mysql[4067]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
/etc/init.d/mysql[4067]


This seems to indicate that /var/lib/mysql/mysql/host.frm got corrupted. Does anyone have a suggestion on how to fix this file? (This file is not readable on my working machine!)
Thanks!

_________________
// Brian - Hardware:
ASUS P5P800 - P4 3Ghz, 500 GB PATA HD
ASUS P5K-V - P4 Core2 Duo, 500 GB SATA HD
Hauppauge PVR-350, IR Blaster, Comcast Digital Cable
http://tech.groups.yahoo.com/group/KnoppMyth/
KnoppMyth R5F27 >> R5.5


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 21, 2009 5:05 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
In R6 this needs to be changed a bit. This worked for me.

Code:
cd /data/srv/mysql/mythconverg
sv stop mythbackend
sv stop mysql
myisamchk *.MYI >> mythconverg_check.log

To repair
Code:
myisamchk -r <table name here>

Then to restart
Code:
sv start mysql
sv start mythbackend


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 21, 2009 7:59 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
This version of optimize_db.sh should work. I thought it had been published here before, but apparently not... :-/

Code:
#!/bin/bash

. /usr/LH/bin/backupcommon || {
    echo 1>&2 "Can not load common settings!"
    exit 1
}

must_be_root

# Prevent mythshutdown from shutting down the system in the middle...
lock_myth

# The database needs to be idle when we do this...
# Having it auto restarted would also be "bad". ;-)
stop_mythbackend
stop_mysqld

cd $DATABASE_DIR || fatal "Could not cd to $DATABASE_DIR"

for tbl in *.MYI ; do
    # If the fast way fails fall back on the old slow way.
    $MYISAMCHK --recover $tbl || {
        echo "Fast recovery of $tbl failed, attempting slower safe recovery..."
        $MYISAMCHK --safe-recover $tbl ||
            fatal "Even safe recovery of $tbl failed! Aborting!"
    }
    $MYISAMCHK --analyze $tbl
done

# Resatart the servers in the right order...
start_mysqld
start_mythbackend

# Unlock the system again...
unlock_myth


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 21, 2009 8:59 pm 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
tjc any chance of getting the updated file put in the Arch (LinHES) repositories to make it easier to get?

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 22, 2009 9:19 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
A week ago I thought it was already there, but apparently it never got added. Maybe this weekend I'll get some breathing room and be able to do it.


Top
 Profile  
 
 Post subject: Re:
PostPosted: Fri Jun 22, 2012 12:47 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
tjc wrote:
This version of optimize_db.sh should work. I thought it had been published here before, but apparently not... :-/

Code:
#!/bin/bash

. /usr/LH/bin/backupcommon || {
    echo 1>&2 "Can not load common settings!"
    exit 1
}

must_be_root

# Prevent mythshutdown from shutting down the system in the middle...
lock_myth

# The database needs to be idle when we do this...
# Having it auto restarted would also be "bad". ;-)
stop_mythbackend
stop_mysqld

cd $DATABASE_DIR || fatal "Could not cd to $DATABASE_DIR"

for tbl in *.MYI ; do
    # If the fast way fails fall back on the old slow way.
    $MYISAMCHK --recover $tbl || {
        echo "Fast recovery of $tbl failed, attempting slower safe recovery..."
        $MYISAMCHK --safe-recover $tbl ||
            fatal "Even safe recovery of $tbl failed! Aborting!"
    }
    $MYISAMCHK --analyze $tbl
done

# Resatart the servers in the right order...
start_mysqld
start_mythbackend

# Unlock the system again...
unlock_myth


Does this script still work with 7.2? I tried the .py script for a table repair, and it didn't work for me, so I had to do the manual procedure outlined in this thread. But I would like to automate it with a cront script above.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ] 
Go to page Previous  1, 2



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu