mysql主辅服务器

mysql主服务器的配置文件 
              server-id = 1
              sql-bin-update-same //同步形式
              binlog-do-db = abc //要同步的数据库
     /usr/local/mysql/bin/mysqladmin shutdown
     /usr/local/mysql/bin/mysqld_safe --user=mysql &
mysql辅服务器的配置文件-1
        server-id = 2 //本Mysql是slave服务器
master-host = 192.168.1.28 //master服务器的IP
master-user = root //连接master服务器的用户
master-password = '' //连接master服务器的密
master-port = 3306 //连接端口
master-connect-retry = 10 //重试次数
replicate-do-db = abc //要同步的数据库
log-slave-updates //同步的形式
        sql-bin-update-same //同步形式
binlog-do-db = abc //要同步的数据库
  
  
  
  
/usr/local/mysql/bin/mysqladmin shutdown
/usr/local/mysql/bin/mysqld_safe --user=mysql &
  
  
  
  
mysql辅服务器的配置文件-2
        server-id = 3 //本Mysql是slave服务器
master-host = 192.168.1.28 //master服务器的IP
master-user = root //连接master服务器的用户
master-password = '' //连接master服务器的密
master-port = 3306 //连接端口
master-connect-retry = 10 //重试次数
replicate-do-db = abc //要同步的数据库
log-slave-updates //同步的形式
   
   
   
   
/usr/local/mysql/bin/mysqladmin shutdown
/usr/local/mysql/bin/mysqld_safe --user=mysql &
 
   
   
   
   
mysql辅服务器的配置文件-3
       server-id = 4 //本Mysql是slave服务器
master-host = 192.168.1.29 //master服务器的IP
master-user = root //连接master服务器的用户
master-password = '' //连接master服务器的密
master-port = 3306 //连接端口
master-connect-retry = 10 //重试次数
replicate-do-db = abc //要同步的数据库
log-slave-updates //同步的形式
    
    
    
    
/usr/local/mysql/bin/mysqladmin shutdown
/usr/local/mysql/bin/mysqld_safe --user=mysql &

本文出自 “荣新1209星云信息” 博客,谢绝转载!

你可能感兴趣的:(mysql,服务器)