#!/bin/bash ulimit -n 5000 export LD_LIBRARY_PATH=/home/zaitsev/mysql-5.1.16/lib/mysql FSPATH="/home/zaitsev/mysql-5016-zip/var" BASEPATH="/home/zaitsev/mysql-5016-zip" MYSQLPATH="$BASEPATH/bin" if [ -e $MYSQLPATH/mysqld ] then MYSQLD="$MYSQLPATH/mysqld" else MYSQLD="$BASEPATH/libexec/mysqld" fi MYSQLADMIN="$MYSQLPATH/mysqladmin" while getopts "a:dmpg" opt; do case $opt in d) DEBUG=1 ;; a) ACT=$OPTARG ;; m) MYISAM=1 ;; p) PBXT=1 ;; esac done LOGERR="--log-error=$FSPATH/err.log" if [ "$DEBUG" == 1 ]; then LOGERR="" fi #echo "debug = $DEBUG act=$ACT" PARAM="--port=3306 \ --socket=/tmp/mysql.sock \ --user=root $LOGERR \ --datadir=$FSPATH \ --basedir=$BASEPATH \ --max_connections=3000 \ --max_connect_errors=10 \ --table_cache=2048 \ --max_allowed_packet=1M \ --binlog_cache_size=1M \ --max_heap_table_size=64M \ --sort_buffer_size=64K \ --join_buffer_size=1M \ --thread_cache=16 \ --thread_concurrency=16 \ --thread_stack=196K \ --query_cache_size=0 \ --ft_min_word_len=4 \ --default_table_type=MYISAM \ --transaction_isolation=REPEATABLE-READ \ --tmp_table_size=64M \ --skip-locking \ --server-id=1 \ --innodb_status_file=0 \ --innodb_data_home_dir=$FSPATH \ --innodb_data_file_path=ibdata1:100M:autoextend \ --innodb_log_group_home_dir=$FSPATH \ --innodb_buffer_pool_size=512M \ --innodb_additional_mem_pool_size=20M \ --innodb_log_file_size=900M \ --innodb_log_files_in_group=2 \ --innodb_log_buffer_size=8M \ --innodb_flush_log_at_trx_commit=1 \ --innodb_lock_wait_timeout=300 \ --innodb_locks_unsafe_for_binlog=1 \ --innodb_thread_concurrency=8 \ --innodb_file_per_table=1 \ --innodb_flush_method=O_DIRECT \ --innodb_commit_concurrency=1 " PARAMPBXT="--no-defaults --port=3306 \ --socket=/tmp/mysql.sock \ --user=root $LOGERR \ --datadir=$FSPATH \ --basedir=$BASEPATH \ --max_connections=3000 \ --max_connect_errors=10 \ --table_cache=2048 \ --max_allowed_packet=1M \ --binlog_cache_size=1M \ --max_heap_table_size=64M \ --sort_buffer_size=64K \ --join_buffer_size=1M \ --thread_cache=16 \ --thread_concurrency=16 \ --thread_stack=196K \ --query_cache_size=0 \ --ft_min_word_len=4 \ --default_table_type=MYISAM \ --transaction_isolation=REPEATABLE-READ \ --tmp_table_size=64M \ --skip-locking \ --server-id=1 \ --skip-innodb " if [ "$ACT" == "on" ]; then RUNPAR=$PARAM if [ "$MYISAM" == 1 ]; then RUNPAR=$PARAMMYISAM fi if [ "$PBXT" == 1 ]; then export pbxt_index_cache_size=512MB export pbxt_record_cache_size=512MB RUNPAR=$PARAMPBXT fi if [ "$DEBUG" == 1 ]; then exec $MYSQLD $RUNPAR else exec $MYSQLD $RUNPAR & fi fi if [ "$ACT" == "off" ]; then exec $MYSQLADMIN -u root shutdown fi