同一臺服務器上啟動多個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規則詳解