1.mysql-server.sh.in 1014 Bytes
Newer Older
1
#!/bin/sh
2 3 4
#
# This is the version for ops. My apologies for the naming sillyness.
#
5

6 7 8 9 10
# PROVIDE: mysql
# REQUIRE: NETWORKING SERVERS mysql-client
# BEFORE: DAEMON
# KEYWORD: shutdown

11
isvers5=`/usr/local/bin/mysql -V | egrep -q -s 'Distrib 5.'`
12 13 14 15 16 17 18

if [ $? -eq 0 ]; then
	safeprog=/usr/local/bin/mysqld_safe
else
	safeprog=/usr/local/bin/safe_mysqld
fi

19
case "$1" in
20
	start|faststart|quietstart|onestart|forcestart)
21
		if [ -x $safeprog ]; then
22
			$safeprog --pid-file=/var/db/mysql/mysqld.pid --user=mysql --log-long-format --log=@prefix@/log/mysql/base --log-bin=@prefix@/log/mysql/update --log-slow-queries=@prefix@/log/mysql/slowqueries -O max_connections=300 -O long_query_time=2 -O key_buffer=32M -O table_cache=256 -O sort_buffer=4M -O record_buffer=1M > /dev/null 2>&1 &
23 24 25
			echo -n ' mysqld'
		fi
		;;
26
	stop|faststop|quietstop|onestop|forcestop)
27 28 29 30 31 32 33 34 35 36 37 38 39 40
		/usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld'
		;;
	*)
		echo ""
		echo "Usage: `basename $0` { start | stop }"
		echo ""
		exit 64
		;;
esac