3
# This is an example SysV-init-script by Winfried Truemper that you can use
4
# and modify to your liking
9
MY_CFG="@prefix@/mysql.cfg"
12
# this routine requires a sed, which reads even the last line of input
14
MY_CONFIG_FILE="$1" # file to read setting from
15
MY_CONFIG_SECTION="$2" # section inside the file
16
MY_CONFIG_TAG="$3" # name of the setting inside the section
17
TAB=`printf "\t" ""` # makes the code cut&paste safe
19
sed -n -f - "$MY_CONFIG_FILE" <<EOF
20
1,/^\[$MY_CONFIG_SECTION\]/ d
23
s/^$MY_CONFIG_TAG[ $TAB]*=[ $TAB]*\([^ $TAB]*\)/\1/
33
nohup ./bin/mysqld --defaults-file="$MY_CFG" &
37
./bin/mysqladmin --defaults-file="$MY_CFG" shutdown
41
PIDS=`ps -efo pid,args | grep mysql | sed -e "s, *.*,," | sort | uniq`
48
MY_PIDFILE=`read_mysql_config "$MY_CFG" "mysqld" "pidfile" `
49
read MY_PID < "$MY_PIDFILE"
55
# z.B. mysql.sh admin "ping"
58
./bin/mysqladmin --defaults-file="$MY_CFG" $@
63
MY_DATADIR=`read_mysql_config "$MY_CFG" "mysqld" "datadir" `
64
./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$1"
70
MY_DATADIR=`read_mysql_config "$MY_CFG" "mysqld" "datadir" `
71
for i in `find "$MY_DATADIR" -name "*.ISM"`
73
./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$i"
79
MY_BASEDIR=`read_mysql_config "$MY_CFG" "mysqld" "basedir"`
80
cd "$MY_BASEDIR" || exit 1