mysqldump or mysqlpump

The binary log information is stored in the SQL file as the CHANGE MASTER TO command based on the options you passed to mysqldump/mysqlpump.

  1. If you have used --master-data, you should use the binary logs of the slave:
shell> head -30 /backups/dump.sql-- MySQL dump 10.13  Distrib 8.0.3-rc, for Linux (x86_64)---- Host: localhost    Database: -- -------------------------------------------------------- Server version 8.0.3-rc-log/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;/*!40101 SET NAMES utf8 */;/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;/*!40103 SET TIME_ZONE='+00:00' ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.