mysql装配脚本,俊哥V5

mysql安装脚本,俊哥V5

#mysql部署过程
#version: v0.1
#date?? : 2010-11-17
#by???? : lee

cd /root
mkdir soft
mkdir /data
cd soft
wget –user=tools –password=easoutools ftp://install.easou.com/database/mysql/mysql-5.0.45.tar.gz
??
tar zxvf mysql-5.0.45.tar.gz
cd mysql-5.0.45
#建立账号和组
groupadd -g 600 mysql
useradd -u? 600 mysql -g mysql -s /sbin/nologin

#建立日志目录
mkdir -p /log/mysql?
#修改权限????????????
chown mysql:mysql -R /log/mysql??
mkdir /data/mysql_log
chown mysql:mysql -R /data/mysql_log
mkdir -p /app/soft/mysql
mkdir /data/mysql
#配置
./configure –prefix=/app/soft/mysql –without-debug –with-charset=utf8 –with-extra-charsets=complex –enable-assembler –without-isam –with-pthread –enable-thread-safe-client –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static? && make && make install

#生成mysql用户数据库和表文件到/data/mysql下?
scripts/mysql_install_db –user=mysql –datadir=/data/mysql

#copy启动的mysqld文件

#修改先关文件夹权限
chmod -R 750 /app/soft/mysql
chmod -R 750 /data/mysql

chgrp -R mysql /app/soft/mysql
mkdir -p /app/soft/mysql/var
chown -R mysql:mysql /app/soft/mysql/var
chown -R mysql:mysql /data/mysql
mkdir -p /data/mysqltmp
chown -R mysql:mysql /data/mysqltmp

#配置my.cnf
cat << EOF > /etc/my.cnf
[client]
default-character-set = utf8
port=3306
socket=/tmp/mysql.sock

[mysqld]
character-set-server = utf8
skip-bdb
skip-locking
skip-name-resolve
#skip-networking
low_priority_updates
innodb_file_per_table
innodb_flush_log_at_trx_commit????? =1
ft_min_word_len???????????????????? =1
server-id?????????????????????????? =1
long_query_time???????????????????? =2
innodb_log_files_in_group?????????? =2
innodb_file_io_threads????????????? =4
net_buffer_length?????????????????? =8K
thread_cache_size?????????????????? =8
thread_concurrency????????????????? =16
innodb_thread_concurrency?????????? =16
wait_timeout??????????????????????? =300
interactive_timeout???????????????? =300
innodb_lock_wait_timeout??????????? =300
innodb_max_dirty_pages_pct????????? =90
delayed_insert_limit??????????????? =256
max_delayed_threads???????????????? =256
back_log??????????????????????????? =512
max_user_connections??????????????? =512
port??????????????????????????????? =3306
max_connections???????????????????? =2048
table_cache???????????????????????? =1024
max_connect_errors????????????????? =1000
table_lock_wait_timeout???????????? =300
connect_timeout???????????????????? =300

thread_stack??????????????????????? =192K
binlog_cache_size?????????????????? =1M
read_buffer_size??????????????????? =8M
max_allowed_packet????????????????? =80M
innodb_log_buffer_size????????????? =16M
sort_buffer_size??????????????????? =16M
join_buffer_size??????????????????? =16M
read_rnd_buffer_size??????????????? =16M
query_cache_limit?????????????????? =16M
query_cache_size??????????????????? =512M
query_cache_type??????????????????? =1
innodb_additional_mem_pool_size???? =16M
key_buffer_size???????????????????? =32M
bulk_insert_buffer_size???????????? =64M
tmp_table_size????????????????????? =256M
max_heap_table_size???????????????? =64M
#innodb_log_file_size??????????????? =256M
innodb_buffer_pool_size???????????? =1G
myisam_sort_buffer_size???????????? =64M

user??????????????????????????????? =mysql
default_table_type????????????????? =MYISAM
innodb_flush_method???????????????? =O_DIRECT
transaction-isolation?????????????? =READ-COMMITTED
tmpdir????????????????????????????? =/data/mysqltmp
basedir???????????????????????????? =/app/soft/mysql
socket????????????????????????????? =/tmp/mysql.sock
datadir???????????????????????????? =/data/mysql
#log-slow-queries?????????????????? =/data/mysql

mysql装配脚本,俊哥V5

相关文章:

你感兴趣的文章:

标签云: