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;
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;