mysql 多实例配置
2016-03-18 18:15
573 查看
[mysqld_multi]
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = root
[mysqld1]
socket = /tmp/mysql.sock
port = 3306
pid-file = /var/mysqld3307/1.pid
datadir = /www/mysql
log = /var/mysqld3307/1.log
user = mysql
[mysqld2]
socket = /tmp/mysql3307.sock
port = 3307
pid-file = /var/mysqld3307/2.pid
datadir = /www/www.fstz.org/mysql
log = /var/mysqld3307/2.log
user = mysql
mysqld_multi --defaults-extra-file=/etc/my_mul.cnf start 1,2
mysqld_safe --defaults-file=/etc/my3308.cnf
--user=mysql --basedir=/usr/local/mysql --datadir=/www/www.fstz.org/mysql
netstat -ntlp
[client]
port = 3307
socket = /tmp/mysql3307.sock
[mysqld]
datadir=/www/www.fstz.org/mysql/
skip-name-resolve
lower_case_table_names=1
innodb_file_per_table=1
port = 3307
socket =/tmp/mysql3307.sock
back_log = 50
max_connections = 300
max_connect_errors = 1000
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 2M
max_heap_table_size = 64M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 64
thread_concurrency = 8
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
default-storage-engine = innodb
thread_stack = 192K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 64M
log-bin=mysql-bin
binlog_format=mixed
slow_query_log
long_query_time = 1
server-id = 1
key_buffer_size = 8M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 200M
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_io_threads = 8
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 16M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 60
innodb_lock_wait_timeout = 120
[mysqldump]
quick
max_allowed_packet = 256M
[mysql]
no-auto-rehash
prompt=\\u@\\d \\R:\\m>
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192
pid-file=/home/mysql/mysql_3302/mysqld.pid
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = root
[mysqld1]
socket = /tmp/mysql.sock
port = 3306
pid-file = /var/mysqld3307/1.pid
datadir = /www/mysql
log = /var/mysqld3307/1.log
user = mysql
[mysqld2]
socket = /tmp/mysql3307.sock
port = 3307
pid-file = /var/mysqld3307/2.pid
datadir = /www/www.fstz.org/mysql
log = /var/mysqld3307/2.log
user = mysql
mysqld_multi --defaults-extra-file=/etc/my_mul.cnf start 1,2
mysqld_safe --defaults-file=/etc/my3308.cnf
--user=mysql --basedir=/usr/local/mysql --datadir=/www/www.fstz.org/mysql
netstat -ntlp
[client]
port = 3307
socket = /tmp/mysql3307.sock
[mysqld]
datadir=/www/www.fstz.org/mysql/
skip-name-resolve
lower_case_table_names=1
innodb_file_per_table=1
port = 3307
socket =/tmp/mysql3307.sock
back_log = 50
max_connections = 300
max_connect_errors = 1000
table_open_cache = 2048
max_allowed_packet = 16M
binlog_cache_size = 2M
max_heap_table_size = 64M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 64
thread_concurrency = 8
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
default-storage-engine = innodb
thread_stack = 192K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 64M
log-bin=mysql-bin
binlog_format=mixed
slow_query_log
long_query_time = 1
server-id = 1
key_buffer_size = 8M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 200M
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_io_threads = 8
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 16M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 60
innodb_lock_wait_timeout = 120
[mysqldump]
quick
max_allowed_packet = 256M
[mysql]
no-auto-rehash
prompt=\\u@\\d \\R:\\m>
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192
pid-file=/home/mysql/mysql_3302/mysqld.pid
相关文章推荐
- mysql5.7 安装后启动服务,显示服务名无效
- mysql 常用sql
- MySQL下mysql.sock丢失
- amoeba 使用笔记
- freeradius+mysql+交换机认证
- entityframework.extended 配置mysql
- mysql 5.6版本免验证密码方式登陆
- win7下安装mysql
- linux下c mysql编程函数总结2
- linux下CMYSQL编程1
- mysql-5.6免安装版配置指南
- mysql数据类型区别
- 升级 MySql 支持 emoji 表情 与 utf8mb4
- MYSQL select时锁定记录问题
- 20+条MySQL性能优化的最佳经验
- Mysql中文乱码解决方案
- mysql5.5更换配置文件my.ini后无法登录
- mysql中二进制形式保存文件数据
- mysql分表的3种方法
- MySQL多实例介绍及安装