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

Reddit!

Related stories


RSS Feed RSS feed logo

About


3com

3ware

alsa

alsactl

alsamixer

amd

android

apache

areca

arm

ati

auditd

awk

badblocks

bash

bind

bios

bonnie

cable

carp

cat5

cdrom

cellphone

centos

chart

chrome

chromebook

cifs

cisco

cloudera

comcast

commands

comodo

compiz-fusion

corsair

cpufreq

cpufrequtils

cpuspeed

cron

crontab

crossover

cu

cups

cvs

database

dbus

dd

dd_rescue

ddclient

debian

decimal

dhclient

dhcp

diagnostic

diskexplorer

disks

dkim

dns

dos

dovecot

drac

dsniff

dvdauthor

e-mail

echo

editor

emerald

encryption

ethernet

expect

ext3

ext4

fat32

fedora

fetchmail

fiber

filesystems

firefox

firewall

flac

flexlm

floppy

flowtools

fonts

format

freebsd

ftp

gdm

gmail

gnome

google

gpg

greasemonkey

greylisting

growisofs

grub

hacking

hadoop

harddrive

hba

hex

hfsc

html

html5

http

https

hulu

idl

ie

ilo

intel

ios

iperf

ipmi

iptables

ipv6

irix

javascript

kde

kernel

kickstart

kmail

kprinter

krecord

kubuntu

kvm

lame

ldap

linux

logfile

lp

lpq

lpr

maradns

matlab

memory

mencoder

mhdd

mkinitrd

mkisofs

moinmoin

motherboard

mouse

movemail

mplayer

multitail

mutt

myodbc

mysql

mythtv

nagios

nameserver

netflix

netflow

nginx

nic

ntfs

ntp

nvidia

odbc

openbsd

openntpd

openoffice

openssh

openssl

openvpn

opteron

parted

partimage

patch

perl

pf

pfflowd

pfsync

photorec

php

pop3

pop3s

ports

postfix

power

procmail

proftpd

proxy

pulseaudio

putty

pxe

python

qemu

r-studio

raid

recovery

redhat

router

rpc

rsync

ruby

saltstack

samba

schedule

screen

scsi

seagate

seatools

sed

sendmail

sgi

shell

siw

smtp

snort

solaris

soundcard

sox

spam

spamd

spf

spotify

sql

sqlite

squid

srs

ssh

ssh.com

ssl

su

subnet

subversion

sudo

sun

supermicro

switches

symbols

syslinux

syslog

systemd

systemrescuecd

t1

tcpip

tcpwrappers

telnet

terminal

testdisk

tftp

thttpd

thunderbird

timezone

ting

tls

tools

tr

trac

tuning

tunnel

ubuntu

unbound

vi

vpn

wget

wiki

windows

windowsxp

wireless

wpa_supplicant

x

xauth

xfree86

xfs

xinearama

xmms

youtube

zdump

zeromq

zic

zlib