Web Hosting Talk







View Full Version : MYSQL bulk table repair


tuvok
08-19-2002, 05:49 AM
Hi Guys/Gals

Some help please :-)

I am trying to repair all the tables in ALL the databases on my Mysql server.

from #../../mysql/bin

./myisam-recover=#

or
./ myisam -r *.MYI

all this is not working, any ideas?

nexcess.net
08-20-2002, 01:33 PM
We use the following startup script to do it:


#!/bin/bash
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 68 12
# description: MySQL database server table checker
# processname: mysqld.check

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

MYSQL_DATADIR='/path/to/mysql/data/dir'

# See how we were called.
case "$1" in
start)
find $MYSQL_DATADIR -name "*.MYI" -print | xargs myisamchk --silent --fast -
-recover
;;
stop)
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac

exit $?


Chris