主服务器:
MySQL> flush tables with read lock;
mysql> flush logs;
mysql> \q
[root@station39~]# mysqldump -uroot --all-database --master-data=2 >/root/master.sql
[root@station39 ~]# vim /root/master.sql
--CHANGE MASTER TO
MASTER_LOG_FILE='mysql-bin.000003', MASTER_LOG_POS=106; //**备份内容截止点
mysql> unlock tables;
将数据发送到从服务器上:
[root@station39 ~]# scp /root/master.sql 192.168.1.13:/root
从服务器:
[root@station26 ~]# mysql -uroot
mysql> change master to
> master_host='192.168.1.11',
>master_port=3306,
> master_user='rep',
> master_password='RedHat',
> master_log_file='master-bin.000003',
>master_log_pos=106;
日志相关参数:
mysql> show binlog events\G;

Event_type:This is the type of the event.
Server_id:This is the server ID of the server that created the event.
Log_name:The name of the file that stores the event.
Pos:This is the position of the file where the event starts; that is, it’s the first byte of the event.
End_log_pos:This gives the position in the file where the event ends and the next event starts.
Info:This is human-readable text with information about the event.
Filter 过滤功能:
在主服务器上过滤:
binlog-do-db:指定当前主服务器中仅允许客户端复制的数据库
binlog-do-ignore-db:指定当前主服务器哪些数据库的更新不记录在Binary Log中,可能会造成主服务器无法进行时间点恢复的致命错误。

