mysql replication 配置方法

mysql 5.5.14

1. master服務器

   配置/etc/my.cnf 參數如下:
   
   server-id=1
   
   開啓bin日誌
   log-bin=mysql-bin
   binlog_format=mixed
   
2. slave服務器

   配置/etc/my.cnf 參數如下:
   server-id=2
   
3. 在master服務器創建replication賬戶
   grant replication slave on *.* to repl@'%.domain.com' identified by 'repl';
   
4. 啓動slave mysql服務器
    
   設置master服務器
   change master to master_host='master_host', master_user='repl', master_password='repl', master_port=3306;
   
   啓動slave服務
   start slave
   
   停止slave服務
   stop slave
   
   show slave status\G;
   show master status\G;
   show processlist\G;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章