mysqld_multi 启动 mysql 多实例
2012-05-17 00:00
453 查看
在一台机器上多启 mysql instance
1. 建立两个 mysql 数据库实例
mysql_install_db --datadir=xxx
2. 配置 /etc/my.cnf
[client]
#password
= your_password
#port = 3306
#socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = mysql
password = mysql
[mysqld1]
datadir = /home/intple/mysql/data1
max_connections = 800
long_query_time = 0.1
#log-queries-not-using-indexes
slow_query_log = 1
slow_query_log_file = /var/log/mysql-slow.log
port = 3306
socket = /home/intple/mysql/data1/mysql.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 32
query_cache_size = 512M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 32
log-bin=mysql-bin
server-id = 1
binlog_format=mixed
innodb_buffer_pool_size = 20G
innodb_additional_mem_pool_size = 32M
innodb_thread_concurrency = 32
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_autoextend_increment = 64M
innodb_lock_wait_timeout = 200
[mysqld2]
datadir = /home/intple/mysql/data2
max_connections = 800
long_query_time = 0.1
#log-queries-not-using-indexes
slow_query_log = 1
slow_query_log_file = /var/log/mysql2-slow.log
port = 3307
socket = /home/intple/mysql/data2/mysql2.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 32
query_cache_size = 512M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 32
log-bin=mysql-bin
server-id
= 1
binlog_format=mixed
innodb_buffer_pool_size = 20G
innodb_additional_mem_pool_size = 32M
innodb_thread_concurrency = 32
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_autoextend_increment = 64M
innodb_lock_wait_timeout = 200
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
3. 启动
mysqld_multi start 1 &
mysqld_multi start 2 &
1. 建立两个 mysql 数据库实例
mysql_install_db --datadir=xxx
2. 配置 /etc/my.cnf
[client]
#password
= your_password
#port = 3306
#socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = mysql
password = mysql
[mysqld1]
datadir = /home/intple/mysql/data1
max_connections = 800
long_query_time = 0.1
#log-queries-not-using-indexes
slow_query_log = 1
slow_query_log_file = /var/log/mysql-slow.log
port = 3306
socket = /home/intple/mysql/data1/mysql.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 32
query_cache_size = 512M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 32
log-bin=mysql-bin
server-id = 1
binlog_format=mixed
innodb_buffer_pool_size = 20G
innodb_additional_mem_pool_size = 32M
innodb_thread_concurrency = 32
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_autoextend_increment = 64M
innodb_lock_wait_timeout = 200
[mysqld2]
datadir = /home/intple/mysql/data2
max_connections = 800
long_query_time = 0.1
#log-queries-not-using-indexes
slow_query_log = 1
slow_query_log_file = /var/log/mysql2-slow.log
port = 3307
socket = /home/intple/mysql/data2/mysql2.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 32
query_cache_size = 512M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 32
log-bin=mysql-bin
server-id
= 1
binlog_format=mixed
innodb_buffer_pool_size = 20G
innodb_additional_mem_pool_size = 32M
innodb_thread_concurrency = 32
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_autoextend_increment = 64M
innodb_lock_wait_timeout = 200
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
3. 启动
mysqld_multi start 1 &
mysqld_multi start 2 &
相关文章推荐
- MySQL之——Linux单机启动多个MySQL实例(mysqld_multi )
- mysqld_multi 多实例启动mysql
- Linux 单机启动多个mysql 实例(mysqld_multi )
- 使用mysqld_multi管理多个MySQL实例
- MYSQL多实例配置方法 mysqld_multi方法
- MySQL单机多实例部署详解之------利用mysqld_multi配置实现
- mysql中利用mysqld_multi实现单机多实例
- MySQL 使用mysqld_multi部署单机多实例详细过程
- mysql dba系统学习(4)mysql的多实例multi启动停止 推荐
- mysqld_multi单机启动多个mysql
- MySQL 使用mysqld_multi部署单机多实例详细过程
- Mysqld_multi在一台服务器上运行多个mysql实例及操作
- 利用mysqld_multi在一台服务器上启动多个mysql服务
- MySQL单机多实例部署详解之------利用mysqld_multi配置实现
- MySQL 使用mysqld_multi部署单机多实例详细过程
- mysqld_multi 多实例启动工具
- MySQL教程-安装篇(三)-Linux上安装MySQL(glibc版)并配置多实例(mysqld_multi)
- Mysqld_multi单机启动多个mysql
- mysqld_multi部署mysql单机多实例
- mysql dba系统学习(4)mysql的多实例multi启动停止