Windows下的 mysql 5.5主从同步配置
2017-01-09 23:10
531 查看
环境说明:
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的数据库名字
replicate-do-db = test
*配置好后,重启Slave 的 MySQL服务!!!
//--------------------------------------------------
登录Slave,然后执行下面命令:
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的话 根据错误编号查找原因
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的数据库名字
replicate-do-db = test
*配置好后,重启Slave 的 MySQL服务!!!
//--------------------------------------------------
登录Slave,然后执行下面命令:
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的话 根据错误编号查找原因
相关文章推荐
- Windows下的 mysql 5.5主从同步配置
- mysql5.5主从同步复制配置
- MySQL5.5主从同步配置及问题
- MySQL5.5数据库主从(Master/Slave)同步配置详解
- mysql5.5主从同步复制配置
- Windows下Mysql主从配置(Mysql5.5)
- Windows下Mysql主从配置(Mysql5.5)
- mysql 5.7 主从同步配置(windows)
- 烂泥:mysql5.5主从同步复制配置
- Windows下MySQL的主从热备(自动同步)配置
- mysql在windows下主从同步配置
- Windows 下配置mysql主从数据库同步
- Mysql主从配置(Mysql5.5)--Windows环境
- mysql5.5主从同步复制配置
- 烂泥:mysql5.5主从同步复制配置
- Windows下Mysql主从配置(Mysql5.5)
- Windows下MySQL的主从热备(自动同步)配置
- Centos6.5 Mysql5.5 主从同步配置
- [置顶] Mysql5.5主从复制配置
- MySQL主从replication半同步设置及支持基于ssl复制配置