mysql5.5主从同步配置文件_Windows下的 mysql 5.5主从同步配置
環(huán)境說明:
Master:127.0.0.1 3306
Slave:127.0.0.1 3307
MySQL 的 Master 配置:
配置my.ini:
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
server-id=200
log-bin=mysql-bin
relay-log=relay-bin
relay-log-index=relay-bin-index
*配置好后,重啟Master 的 MySQL服務!!!
//--------------------------------------------------
MySQL 的 Slave 配置:
配置my.ini:
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
server-id = 210
//同步Master的數(shù)據(jù)庫名字
replicate-do-db = test
*配置好后,重啟Slave 的 MySQL服務!!!
//--------------------------------------------------
登錄Slave,然后執(zhí)行下面命令:
mysql> stop slave;
mysql> change master to master_host='192.168.1.200',master_user='root',master_password='123456';
mysql> start slave;
mysql> show slave status;
查看這兩項是否為YES,yes為正常。
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
如果有為no的話 根據(jù)錯誤編號查找原因
《新程序員》:云原生和全面數(shù)字化實踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的mysql5.5主从同步配置文件_Windows下的 mysql 5.5主从同步配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: div 设置 hover时边框颜色_CS
- 下一篇: jpa hibernate mysql_