| View previous topic :: View next topic |
| Author |
Message |
tjc
Joined: 25 Mar 2004 Posts: 9120 Location: Arlington, MA
|
|
| Back to top |
|
 |
datobin1
Joined: 21 Dec 2005 Posts: 143 Location: Charlotte NC USA
|
Posted: Mon Feb 04, 2008 6:57 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
BluesBrian
Joined: 28 Jul 2005 Posts: 224 Location: SF East Bay, CA
|
Posted: Sat Feb 23, 2008 11:32 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Too Many Secrets
Joined: 20 Oct 2006 Posts: 847 Location: LA, CA
|
Posted: Wed Oct 21, 2009 3:05 pm Post subject: |
|
|
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 |
|
|
| Back to top |
|
 |
tjc
Joined: 25 Mar 2004 Posts: 9120 Location: Arlington, MA
|
Posted: Wed Oct 21, 2009 5:59 pm Post subject: |
|
|
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
|
_________________ KnoppMyth Wiki
Troubleshooting guides
R5.5 Hints |
|
| Back to top |
|
 |
Girkers
Joined: 22 Mar 2005 Posts: 1193 Location: Brisbane, Queensland, Australia
|
Posted: Wed Oct 21, 2009 6:59 pm Post subject: |
|
|
tjc any chance of getting the updated file put in the Arch (LinHES) repositories to make it easier to get? _________________ Girkers
www.gkcomputerservices.com |
|
| Back to top |
|
 |
tjc
Joined: 25 Mar 2004 Posts: 9120 Location: Arlington, MA
|
Posted: Thu Oct 22, 2009 7:19 pm Post subject: |
|
|
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. _________________ KnoppMyth Wiki
Troubleshooting guides
R5.5 Hints |
|
| Back to top |
|
 |
|