标签:max ip地址 show server-id 地址 tab var running super
主库cnf增加
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = jrt
binlog_ignore_db = information_schema
binlog_ignore_db = mysql
binlog_ignore_db = performance_schema
binlog_ignore_db = sys
主库增加账号
grant replication slave on *.* to ‘backup‘@‘%‘ identified by ‘123123‘;
从库配置增加
server_id=2
read_only = 1
master_info_repository=TABLE
relay_log_info_repository=TABLE
#relay_log_recovery=1 #从库禁止写
#super_read_only=1 #从库禁止写
从库执行
stop slave;
change master to
master_host=‘IP地址‘, #master的ip
master_user=‘backup‘, #备份用户名
master_password=‘123123‘, #密码
master_log_file=‘mysql-bin.000001‘, #主库show master status; File
master_log_pos=701; #主库show master status; Position
start slave;
从库看看状态
show slave status;
Slave_IO_Running Yes
Slave_SQL_Running Yes
标签:max ip地址 show server-id 地址 tab var running super
原文地址:http://www.cnblogs.com/liupin/p/7845051.html