windows mysql 主从热备
2015-12-15 10:21
519 查看
环境说明:
Master:192.168.1.200
Slave:192.168.1.210
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
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\G;
查看这两项是否为YES,yes为正常。
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Master:192.168.1.200
Slave:192.168.1.210
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
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\G;
查看这两项是否为YES,yes为正常。
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
相关文章推荐
- MySQL5.5 performance_schema的介绍
- cmake安装mysql
- MySQL的information_schema的介绍
- MySQL中几种数据统计查询的基本使用教程
- MySQL安装与介绍
- 使用PowerDesigner15在win7下的系统MySQL p相反roject(一)
- mysql常用命令大全
- 更改MySQL数据文件目录位置
- windows下mysql zip版安装
- mysql =》 mysql 命令恢复数据库
- mysql => mysql数据库备份 命令
- 基于vc6.0和mysql55的邮件管理系统有源码
- mysql 变量报错 (error encountered during command execution)
- 十五大原理之零四:MYSQL主从同步原理
- mysql 触发器应用《mysql 5.6从零开始学》
- MySQL中几种数据统计查询的基本使用教程
- mysql允许远程连接的方法
- [转]关于mysql中explain的那些事儿
- MySQL提高缓存命中率
- Mysql二进制日志文件的管理