[Sysadmin] mysql crash fixed 2012-04-13

William Anderson neuro at well.com
Fri Apr 13 10:31:22 CDT 2012


lo all,

whoever is controlling the evolt_org twitter account decided it was
the best way to request help with crashed tables on tron.  I'm pretty
sure I've mentioned previously that this is not really a timely manner
in which to get a hold of me if someone wants some assistance.  I
finally saw the twitter mention (2 days later) and did the following
just now:

backed up /var/lib/mysql/www_evolt_org to /backup/tmp/

did some myisamchk voodoo on the crashed tables thusly:


root at tron:/var/lib/mysql# cd www_evolt_org/
root at tron:/var/lib/mysql/www_evolt_org# myisamchk -r -q access
- check record delete-chain
- recovering (with sort) MyISAM-table 'access'
Data records: 26
- Fixing index 1
root at tron:/var/lib/mysql/www_evolt_org# myisamchk -r -q cache
- check record delete-chain
- recovering (with sort) MyISAM-table 'cache'
Data records: 17172
- Fixing index 1
Wrong bytesec:  76-178- 53 at   41225700; Skipped
MyISAM-table 'cache' is not fixed because of errors
Try fixing it by using the --safe-recover (-o), the --force (-f)
option or by not using the --quick (-q) flag
root at tron:/var/lib/mysql/www_evolt_org# myisamchk -r cache
- recovering (with sort) MyISAM-table 'cache'
Data records: 7398
- Fixing index 1
Wrong bytesec:  76-178- 53 at   41225700; Skipped
Found link that points at -8986620969051591440 (outside data file) at 41226084
Found link that points at 8466116911889054427 (outside data file) at 41226120
Found link that points at 7235376349516554574 (outside data file) at 41227132
Found block with too small length at 41227204; Skipped
Found link that points at -934824566340612735 (outside data file) at 41227664
Found link that points at 8239546697813861678 (outside data file) at 41227740
Found link that points at 3916135557965841572 (outside data file) at 41227856
Found link that points at 5428322186454174178 (outside data file) at 41228080
Found block with too small length at 41228460; Skipped
Found link that points at 1358255560818259274 (outside data file) at 41228808
Found block with too small length at 41229084; Skipped
Found link that points at 2207259949105094741 (outside data file) at 41229896
- Fixing index 2
Data records: 12496
root at tron:/var/lib/mysql/www_evolt_org# myisamchk -r -q sessions
- check record delete-chain
- recovering (with sort) MyISAM-table 'sessions'
Data records: 22099
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4


I restarted mysql, but the accesslog table showed as crashed in
syslog, so I did this:


root at tron:/var/lib/mysql/www_evolt_org# /etc/init.d/mysql start
 * Starting MySQL database server mysqld
   ...done.
 * Checking for corrupt, not cleanly closed and upgrade needing tables.

Apr 13 10:22:10 tron /etc/mysql/debian-start[5744]: WARNING:
mysqlcheck has found corrupt tables
Apr 13 10:22:10 tron /etc/mysql/debian-start[5744]: www_evolt_org.accesslog
Apr 13 10:22:10 tron /etc/mysql/debian-start[5744]: warning  : Table
is marked as crashed

root at tron:/var/lib/mysql/www_evolt_org# /etc/init.d/mysql stop
 * Stopping MySQL database server mysqld
   ...done.
root at tron:/var/lib/mysql/www_evolt_org# myisamchk -r accesslog
- recovering (with sort) MyISAM-table 'accesslog'
Data records: 5750060
- Fixing index 1
- Fixing index 2


Restarted mysql and it seems to be working now.

Good times.

-n


More information about the Sysadmin mailing list