【mysql断电重启后修复myisam表错误】fix_myisam_table.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/bash
#
# 2014/10/13
fix_bin=
'/usr/bin/myisamchk'
d_db_data=
'/data/mysql_data/3306'
dt=`
date
+
"%y%m%d"
`
cd
${d_db_data}
echo
'>>==========================='
tail
`
hostname
`.err -n 200 |
grep
$dt |
grep
"Checking table"
|
awk
'{print $NF}'
echo
'----------------------------------------------------'
tail
`
hostname
`.err -n 200 |
grep
$dt |
grep
"Checking table"
|
awk
'{print $NF}'
|
xargs
-i ${fix_bin} {}
echo
'<<==========================='
|
本文转自 pcnk 51CTO博客,原文链接:http://blog.51cto.com/nosmoking/1594787,如需转载请自行联系原作者