1、二进制日志
主:
#mastervim /etc/mysql/my.cnf#server-idserver-id=2#二进制日志 log-bin=musql-bin#statement row mixedbinlog-format=mixed
从:
#slavevim /etc/mysql/my.cnf#server-idserver-id=2relay-log-mysql-relay
2、授权
#mastermysql -urootmysql>glant replication client,replication slave on *.* to 'repl'@ip identified by 'repl'
#slavemysq -uroot#master中使用show master status查看Position,Filemysql>change master to master_host='master IP',master_user='repl',master_password='repl',master_log_file='mysql-bin.00000x',master_log_pos=xxx mysql>show slave status \G #查看 mysql>start slave;