192.168.150.135:3306 (mysql主服务器)
192.168.150.136:3306(mysql备份服务器)
查看我之前的博客:http://blog.csdn.net/caicongyang/article/details/50614464
grant replication slave,replication client on *.* to repl@'192.168.150.%' identified by '123456';
主服务器(192.168.150.135)配置文件my.cnf
修改或增加以下配置(注server_id为任意唯一数字)
log_bin=mysql-bin server_id=135
log_bin=mysql-bin server_id=136 relay_log=/var/lib/mysql/mysql-replay-bin log_slave_updates=135 read_only=135
修改完配置后主备服务器均需要重启:
#service mysqld restart
首先登录备份服务器mysql;
5.1下一步是告诉备库如何连接主库并放置其日志文件
change master to master_host='192.168.150.135', master_user='repl', master_log_file='mysql-bin.000001', master_log_pos=0;
start slave;
show slave status\G;看到以下信息算启动复制成功:
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
更多多线程精彩内容请继续关注我的博客:http://blog.csdn.net/caicongyang