You know that binary logs are needed for point-in-time recovery. In this section, you will understand how to take a backup of binary logs. The process streams the binary logs from the database server to a remote backup server. You can take the binary log backup from either the slave or the master. If you are taking the binary log backup from the master and the actual backup from the slave, you should use --dump-slave
to get the corresponding master log position. If you are using mydumper
or XtraBackup, it gives both the master and slave binary log positions.
- Create a replication user on the server. Create a strong password:
mysql> GRANT REPLICATION SLAVE ON *.* TO 'binlog_user'@'%' IDENTIFIED BY 'binlog_pass'; Query OK, 0 rows affected, 1 warning (0.03 sec)
- Check the binary logs on the server:
mysql> SHOW BINARY LOGS; +----------------+-----------+ | Log_name | File_size | +----------------+-----------+ | server1.000008 |2451 | | server1.000009 | 199 |...