同一台服务器上启动多个mysql实例
添加时间:2012-6-13
添加:
admin
如何在同一台服务器上启动多个mysql实例?
修改 /etc/my.cnf: (添加mysqld_multi段,修改添加 mysqldx)
如下配置:[mysqld_multi]
mysqld=/usr/local/mysql/bin/mysqld_safe
mysqladmin=/usr/local/mysql/bin/mysqladmin
user=mysql[mysqld1]
datadir=/db/mysql_3306
port = 3306
socket = /tmp/mysql_3306.sock
skip-locking
pid-file=/db/mysql_3306/DBServer-TJ45_3306.pid
skip-name-resolv
key_buffer = 384M
max_allowed_packet = 1M
table_cache =4096
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
query_cache_limit = 1024
thread_concurrency = 8
master-host=192.168.1.10
master-user=ztgame
master-password=123456
master-port=3306
server-id = 2
replicate-do-db=GameServer
replicate-ignore-db=mysql
master-connect-retry=60[mysqld2]
datadir=/db/mysql_3307
port = 3307
socket = /tmp/mysql_3307.sock
skip-locking
pid-file=/db/mysql_3307/DBServer-TJ45_3307.pid
skip-name-resolv
key_buffer = 384M
max_allowed_packet = 1M
table_cache =4096
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
query_cache_limit = 1024
thread_concurrency = 8
master-host=192.168.1.20
master-user=ztgame
master-password=123456
master-port=3306
server-id=2
replicate-do-db=GameServer
replicate-ignore-db=mysql
master-connect-retry=60
启动:
mysqld_multi Cconfig-file=/etc/my.cnf start|stop|report X #X就是[mysqldX]
mysqld_multi start #启动所有的MYSQL服务
mysqld_multi report 1,2,3,4,5 #查看启动状态关闭:
mysqladmin shutdown -h192.168.1.1 -uroot -p123456 --socket=/tmp/mysql_3306.sock -P3306
mysqld_multi stop
关键字:服务器
修改 /etc/my.cnf: (添加mysqld_multi段,修改添加 mysqldx)
如下配置:[mysqld_multi]
mysqld=/usr/local/mysql/bin/mysqld_safe
mysqladmin=/usr/local/mysql/bin/mysqladmin
user=mysql[mysqld1]
datadir=/db/mysql_3306
port = 3306
socket = /tmp/mysql_3306.sock
skip-locking
pid-file=/db/mysql_3306/DBServer-TJ45_3306.pid
skip-name-resolv
key_buffer = 384M
max_allowed_packet = 1M
table_cache =4096
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
query_cache_limit = 1024
thread_concurrency = 8
master-host=192.168.1.10
master-user=ztgame
master-password=123456
master-port=3306
server-id = 2
replicate-do-db=GameServer
replicate-ignore-db=mysql
master-connect-retry=60[mysqld2]
datadir=/db/mysql_3307
port = 3307
socket = /tmp/mysql_3307.sock
skip-locking
pid-file=/db/mysql_3307/DBServer-TJ45_3307.pid
skip-name-resolv
key_buffer = 384M
max_allowed_packet = 1M
table_cache =4096
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
query_cache_limit = 1024
thread_concurrency = 8
master-host=192.168.1.20
master-user=ztgame
master-password=123456
master-port=3306
server-id=2
replicate-do-db=GameServer
replicate-ignore-db=mysql
master-connect-retry=60
启动:
mysqld_multi Cconfig-file=/etc/my.cnf start|stop|report X #X就是[mysqldX]
mysqld_multi start #启动所有的MYSQL服务
mysqld_multi report 1,2,3,4,5 #查看启动状态关闭:
mysqladmin shutdown -h192.168.1.1 -uroot -p123456 --socket=/tmp/mysql_3306.sock -P3306
mysqld_multi stop
关键字:服务器
新文章:
- CentOS7下图形配置网络的方法
- CentOS 7如何添加删除用户
- 如何解决centos7双系统后丢失windows启动项
- CentOS单网卡如何批量添加不同IP段
- CentOS下iconv命令的介绍
- Centos7 SSH密钥登陆及密码密钥双重验证详解
- CentOS 7.1添加删除用户的方法
- CentOS查找/扫描局域网打印机IP讲解
- CentOS7使用hostapd实现无AP模式的详解
- su命令不能切换root的解决方法
- 解决VMware下CentOS7网络重启出错
- 解决Centos7双系统后丢失windows启动项
- CentOS下如何避免文件覆盖
- CentOS7和CentOS6系统有什么不同呢
- Centos 6.6默认iptable规则详解