pantz.org banner
Fixing MySQL crashed tables
Posted on 03-20-2007 03:22:00 UTC | Updated on 03-20-2007 03:22:00 UTC
Section: /software/mysql/ | Permanent Link

Got home tonight and mythtv machine was locked up solid. Rebooted it and noticed I had no program data. Tried deleting the data in the program guide and refilling it to no avail. Then I noticed this at the end of running mythfilldatabase:

2007-03-18 21:03:52.424 DB Error (DelLogEntry#1):
Query was:
SELECT logid FROM mythlog WHERE module= 'mythfilldatabase' ORDER BY logdate ASC;
Driver error was [2/145]:
QMYSQL3: Unable to execute query
Database error was:
Table './mythconverg/mythlog' is marked as crashed and should be repaired

Crashed table. Yuck!

Tried fixing that one with the command

mysqlcheck --auto-repair --check -u mythtv -pmysqlpass

To which I got back

mythconverg.mythlog
error    : Table './mythconverg/mythlog' is marked as crashed and should be repaired
Repairing tables
mythconverg.mythlog                                OK

Then I ran mythfilldatabase again and went to my mythtv webpage to look for program data.

It told me another table had crashed and needed to be repaired. So I figured other tables must have crashed as well so I just wanted to find a blanket command to check and fix all the tables with problems. I put this one together from the --help page and it did the trick. Everything is back up and working. The following command that did it was

mysqlcheck --auto-repair -A -u mythtv -pmysqlpass

It finds all corrupted tables and fixes them if possible. Output from command is below. Output from this command is below. The "..." is space where lot's of other tables were.

mythconverg.gameplayers                            OK
mythconverg.housekeeping                           OK
...
mythconverg.inuseprograms
error    : Table './mythconverg/inuseprograms' is marked as crashed and should
be repaired
mythconverg.oldfind                                OK
mythconverg.oldprogram                             OK
...
mythconverg.oldrecorded
error    : Table './mythconverg/oldrecorded' is marked as crashed and should be
repaired
mythconverg.recordedrating                         OK
...
mythconverg.recordedseek
error    : Table './mythconverg/recordedseek' is marked as crashed and should be
repaired
...
mythconverg.videosource                            OK
mythconverg.videotypes                             OK

Repairing tables
mythconverg.inuseprograms
warning  : Number of rows changed from 3 to 1
status   : OK
mythconverg.oldrecorded
warning  : Number of rows changed from 5454 to 5455
status   : OK
mythconverg.recordedseek
warning  : Number of rows changed from 471859 to 471860
status   : OK

Del.icio.us! | Digg Me! | Reddit!

Related stories


RSS Feed RSS feed logo
About


3com
3ware
alsa
alsactl
alsamixer
amd
apache
areca
arm
ati
auditd
awk
badblocks
bind
bios
bonnie
cable
carp
cat5
cdrom
centos
chart
cifs
cisco
comcast
commands
comodo
compiz-fusion
corsair
cpufreq
cpufrequtils
cpuspeed
cron
crontab
crossover
cu
cups
cvs
database
dd
dd_rescue
ddclient
debian
decimal
dhclient
dhcp
diagnostic
diskexplorer
disks
dns
dos
dovecot
dsniff
dvdauthor
e-mail
editor
emerald
ethernet
ext3
fat32
fedora
fetchmail
fiber
filesystems
firefox
firewall
flexlm
floppy
flowtools
fonts
format
ftp
gdm
gnome
greylisting
growisofs
grub
harddrive
hba
hex
hfsc
html
http
idl
ie
intel
ios
ipmi
iptables
irix
javascript
kde
kernel
kmail
kprinter
krecord
kubuntu
linux
logfile
maradns
matlab
memory
mencoder
mhdd
mkinitrd
mkisofs
moinmoin
motherboard
mouse
movemail
mplayer
multitail
mutt
myodbc
mysql
mythtv
nagios
nameserver
netflow
nic
ntfs
ntp
nvidia
odbc
openbsd
openntpd
openoffice
openssl
opteron
parted
partimage
patch
perl
pf
pfflowd
pfsync
photorec
php
pop3
pop3s
ports
postfix
power
procmail
proftpd
proxy
pxe
python
qemu
r-studio
raid
recovery
router
rpc
rsync
samba
schedule
scsi
seagate
seatools
sendmail
sgi
shell
siw
smtp
snort
solaris
soundcard
spam
spamd
sql
sqlite
squid
ssh
ssl
subnet
subversion
sun
supermicro
switches
symbols
syslinux
systemrescuecd
t1
tcpip
tcpwrappers
telnet
terminal
testdisk
tftp
thttpd
thunderbird
timezone
tools
tr
trac
tuning
tunnel
vi
wget
wiki
windows
windowsxp
wireless
wpa_supplicant
x
xauth
xfree86
xfs
xinearama
xmms
zdump
zic
zlib