本篇文章主要介绍了"MySQL5710最新版初始化安装及多实例创建自动部署脚本",主要涉及到chmod,CentOS6.5,CentOS6方面的内容,对于其他数据库感兴趣的同学可以参考一下:
mysql5.7.10_onekey_install.sh自动化部署脚本支持mysql5.7.10初始化安装,多实例创建,且使用经过优化后的my.cnf配置文件...
[client]
port = 3306
socket = /data/3306/mysql.sock
character-set-server = utf8
[mysql]
no-auto-rehash
[mysqld]
user = mysql
port = 3306
character-set-server = utf8
socket = /data/3306/mysql.sock
basedir = /opt/application/mysql
datadir = /data/3306/data
explicit_defaults_for_timestamp = true
skip-ssl
secure-file-priv = NULL
lower_case_table_names = 1
back_log = 300
max_connections = 3000
max_connect_errors = 100
table_open_cache = 4096
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 16
query_cache_size = 128M
query_cache_limit = 4M
ft_min_word_len = 8
thread_stack = 512K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 128M
max_heap_table_size = 128M
###*** slow query parameters
long_query_time = 6
slow_query_log
slow_query_log_file = /data/3306/slow.log
###*** binlog parameters
log-bin = /data/3306/mysql-bin
binlog_cache_size = 4M
max_binlog_cache_size = 16M
max_binlog_size = 32M
binlog_format = MIXED
expire_logs_days = 7
###*** relay-log parameters
#relay-log = /data/3307/relay-bin
#relay-log-info-file = /data/3307/relay-log.info
#master-info-repository = table
#relay-log-info-repository = table
#relay-log-recovery = 1
#*** MyISAM parameters
key_buffer_size = 16M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 1M
#skip-name-resolve
###*** master-slave replication parameters
server-id = 105
slave-skip-errors = all
#*** Innodb storage engine parameters
innodb_buffer_pool_size = 6G
innodb_data_file_path = ibdata1:10M:autoextend
#innodb_file_io_threads = 8
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = on
[mysqldump]
quick
max_allowed_packet = 32M
[myisamchk]
key_buffer = 16M
sort_buffer_size = 16M
read_buffer = 8M
write_buffer = 8M
[mysqld_safe]
open-files-limit = 8192
log-error=/data/3306/mysql_3306.err
pid-file=/data/3306/mysqld.pid
四、MySQL启动脚本(mysql.server)
#!/bin/sh
# This is an interactive program, we needthe current locale
[ -f
/etc/profile
.d
/lang
.sh ] && .
/etc/profile
.d
/lang
.sh
# We can't Japanese on normal console atboot time, so force.
if
[
"$LANG"
=
"ja"
-o
"$LANG"
=
"ja_JP.eucJP"
];
then
if
[
"$TERM"
=
"linux"
] ;
then
LANG=C
fi
fi
# Source function library.
.
/etc/init
.d
/functions