What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
To restore a failed MySQL slave server—called a replica in current MySQL documentation—first stop replication on the replacement, load a consistent snapshot, then reconnect it with coordinates that belong to that snapshot. In a file-position topology, use the recorded SOURCE_LOG_FILE and SOURCE_LOG_POS. In a GTID topology, use SOURCE_AUTO_POSITION=1 so MySQL compares executed transactions instead of relying on manually chosen offsets. Start replication only after the import is complete, then verify the channel, GTID or position state, and application consistency before treating the server as a promotion candidate.
This procedure applies to MySQL 8.4 and uses the current terms source and replica. The older “master” and “slave” wording remains in the title because it is still used in searches and in some legacy option names.
Free tools Windows power users keep installed
One-click scans. No signup required.
As an Amazon Associate I earn from qualifying purchases.
What is the safe way to restore a MySQL slave server?
A safe rebuild has four distinct phases: freeze the replacement, restore a consistent data snapshot, configure replication from metadata that matches that snapshot, and validate the result. Skipping the freeze or guessing coordinates can cause duplicate transactions, gaps, or execution of scheduled events that already ran before the failure.
- Freeze the replacement: start MySQL with
--skip-replica-startso no applier thread changes data during the import. - Restore data: load a logical dump, copy a physical backup, or clone from a donor while replication remains stopped.
- Reconnect: use
CHANGE REPLICATION SOURCE TO. File-position channels require the exact source log file and position captured with the snapshot; GTID channels normally useSOURCE_AUTO_POSITION=1. - Start and validate: run
START REPLICA, inspect channel status and error fields, and check that the restored data is suitable for the intended role.
Do not hand-edit replication connection or applier metadata tables. MySQL uses those repositories to track processed binary-log information, and repository values can override command-line or my.cnf settings. Change replication parameters with the SQL statement documented for the server version.
Popular on Amazon
Which terminology and topology does this procedure cover?
MySQL 8.4 documentation calls the write-producing server the source and the receiving server the replica. “Master” and “slave” describe the same relationship in older deployments. Restoration differs mainly by how the topology identifies the point at which the snapshot was taken.
| Topology or method | State used to resume | Best fit | Important risk |
|---|---|---|---|
| GTID with auto-positioning | Executed GTID set and SOURCE_AUTO_POSITION=1 |
Existing GTID-enabled topologies and repeatable rebuilds | Required GTIDs may have been purged, or the source and replica may contain conflicting transactions. |
| Binary-log file position | Exact SOURCE_LOG_FILE and SOURCE_LOG_POS |
Legacy or anonymous-transaction configurations | A wrong coordinate creates a gap or re-applies transactions. |
| Clone plugin | Donor position or GTID state plus replication repositories | Fast physical provisioning from a compatible donor | Binary and relay log files are not copied; multithreaded file-position recovery may need manual channel setup. |
| Logical dump or raw backup | Snapshot coordinates, embedded source data, or GTID metadata | Portable restores and conventional backup workflows | Import duration, file ownership, and keeping replication stopped during the load. |
| MySQL Enterprise Backup | Physical snapshot and replication coordinates | Commercial backup workflows | It is part of a MySQL Enterprise subscription; current reseller or partner terms must be checked separately. |
What should be checked before importing the backup?
The replacement must be a controlled, consistent copy of the source’s data. Before starting the import, identify the replication mode, confirm that the backup is complete, and preserve the metadata that ties the snapshot to the source’s transaction history.
Confirm the topology
- Determine whether the channel uses GTIDs or anonymous/file-position transactions. Use the same model during restoration unless the topology is deliberately being redesigned.
- For file-position recovery, obtain the source log file and position recorded for the exact snapshot. A coordinate from another backup is not interchangeable.
- For GTID recovery, verify that the source still retains the transaction history the replacement will request. Auto-positioning cannot retrieve transactions that no source still has.
- Confirm the replication account, source host name, and network path that the replacement will use.
Protect scheduled events
If the donor or source has scheduled events, disable event_scheduler on the new replica during provisioning, or mark individual events disabled. Otherwise, an event that already executed before the failure could execute again while the replacement is being brought online.
Prepare the replacement data directory
Stop any old MySQL instance that could write to the target directory. When extracting raw files, restore the ownership and permissions expected by the MySQL server account. Keep the server in the --skip-replica-start state until the snapshot import and all post-import checks are complete.
How do I freeze a replacement server before the restore?
Start the replacement with replication disabled, commonly by adding --skip-replica-start to the startup command or the instance configuration for this recovery. This prevents the applier from changing restored tables while a dump or physical copy is still being loaded.
- Stop the failed instance if it can still run, and ensure only the replacement will use the restored data directory.
- Configure the replacement to start with
--skip-replica-start. - Start MySQL and verify that replication has not been started automatically.
- Disable the event scheduler or the relevant events before importing data.
- Import the snapshot or complete the clone.
- Only after the import succeeds, issue
CHANGE REPLICATION SOURCE TOand thenSTART REPLICA.
Do not edit connection or applier repository tables to force a state. Their contents are part of MySQL’s replication metadata and can take precedence over settings supplied in configuration files.
How do I restore a replica that uses binary-log file positions?
File-position restoration depends on two values captured when the snapshot was taken: the source’s binary-log file name and the exact position in that file. Obtain those values from the backup procedure or snapshot record; never invent them or substitute the latest position observed after the backup.
1. Capture a matching snapshot and coordinate
Create or locate a consistent source snapshot and its corresponding binary-log file and position. The coordinate must describe the point represented by the snapshot, not merely the source’s current position. If the backup process did not record a matching coordinate, obtain a newer, properly coordinated backup instead of guessing.
Also popular on Amazon
2. Import while replication is stopped
Start the replacement with --skip-replica-start. Import the logical dump, or extract the raw data files into the replacement data directory. Correct ownership and permissions if files were copied from another host, and leave the replica stopped until the import has completed successfully.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →3. Configure the source connection and position
Run the documented statement with the values belonging to this snapshot:
CHANGE REPLICATION SOURCE TO
SOURCE_HOST='source_host_name',
SOURCE_USER='replication_user_name',
SOURCE_PASSWORD='replication_password',
SOURCE_LOG_FILE='recorded_log_file_name',
SOURCE_LOG_POS=recorded_log_position;
Replace every example value. The log file and position must be the pair recorded for the imported snapshot. A syntactically valid statement with an unrelated coordinate is still an invalid restore.
4. Start and inspect the channel
START REPLICA;
After the channel starts, confirm that the replica connects to the source and applies updates made after the snapshot point. Check both the receiver and applier status, their last error fields, and the source log position being consumed. If an error appears, stop and correct the coordinate or connection problem before allowing application traffic to depend on the server.
How do I restore a GTID-based replica?
GTIDs identify transactions independently of file and offset pairs. When the source and replica already use compatible GTID modes and the source retains the required history, the replacement can advertise its executed GTID set and let the source send only transactions it does not already contain.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match1. Create a dump that carries source and GTID information
For an online InnoDB logical backup, MySQL documents a command such as:
mysqldump --all-databases --source-data --single-transaction > all_databases.sql
--source-data embeds a CHANGE REPLICATION SOURCE TO statement in the dump. The --set-gtid-purged option controls whether executed GTIDs are included; AUTO is the default, while ON explicitly requests that GTID information be written. Use the setting that matches the topology and the way the dump will be provisioned.
2. Import with replication disabled
Start the replacement using --skip-replica-start, disable scheduled events as appropriate, and import all_databases.sql. Do not start the replica during the import. The dump’s embedded statement and GTID state are useful only when the restored data and the recorded transaction history remain together.
Also popular on Amazon
3. Enable GTID auto-positioning
After the import, configure the source connection and tell the channel to use GTIDs:
CHANGE REPLICATION SOURCE TO
SOURCE_HOST='source_host_name',
SOURCE_USER='replication_user_name',
SOURCE_PASSWORD='replication_password',
SOURCE_AUTO_POSITION=1;
Then start the channel:
START REPLICA;
The source must use GTIDs for auto-positioning to work. The replica sends its executed and received GTID sets; the source supplies transactions that are not already present. No manually selected log file or offset is required for this exchange.
4. Check for history retention
Auto-positioning still depends on the source retaining every transaction the replacement needs. Review binary-log retention, including binlog_expire_logs_seconds, before a rebuild. If required transactions were purged, use a newer backup or another source that still has them.
What does the MySQL clone plugin restore, and what does it omit?
The clone plugin can copy data from a donor source or replica and transfer the donor’s binary-log position, gtid_executed set, and replication metadata repositories. It does not copy the donor’s binary-log files or relay-log files.
With GTID auto-positioning and compatible GTID modes, an existing channel may resume when started because the recipient has the donor’s transaction state. With file-position channels, the transferred position is used and relay-log recovery is attempted. A single-threaded channel may recover automatically, while a multithreaded file-position channel can require manual channel setup if relay-log recovery fails.
Operational implications of a clone
- Plan for the absence of binary and relay logs on the recipient; the channel must obtain any needed transactions from a source that still retains them.
- Do not promise automatic resumption solely because cloning completed. Behavior depends on GTID versus file-position mode and on whether the channel is single-threaded or multithreaded.
- After cloning, start the channel only after confirming the source connection and checking the transferred metadata.
- If relay-log recovery fails for a multithreaded file-position channel, perform the documented manual channel setup rather than editing repository tables.
Which other provisioning methods are available?
For very large histories, replaying every transaction from the beginning can be unnecessary. MySQL describes provisioning with a snapshot of the data set, the relevant binary logs, and global transaction information so the replacement begins close to the source’s current state.
Raw data files
Direct data-directory copying can be used with gtid_mode=ON when the files and transaction metadata come from a consistent snapshot. The destination still needs replication disabled during the copy and correct filesystem ownership afterward.
MySQL Enterprise Backup
MySQL Enterprise Backup is a commercial product included with a MySQL Enterprise subscription. It provides a physical-backup workflow in which the snapshot and replication coordinates are handled as part of provisioning. Product availability and partner terms vary and should be verified for the relevant subscription and region.
Also popular on Amazon
Binary-log transfer with mysqlbinlog
When the source retains a complete GTID history, MySQL documents transferring binary logs with mysqlbinlog as another provisioning variant. This is useful when the replacement must receive transaction history in addition to a data snapshot, but it still requires a consistent starting state and a source that has not purged the required logs.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →How do I verify that the restored replica is safe?
A running channel is not proof that the restored server is correct. Validate transport, application, transaction state, and data consistency before using the server for reads that require current data or considering it for promotion.
Replication-channel checks
- Confirm the receiver thread connects to the intended source and is not repeatedly reconnecting.
- Confirm the applier thread is running and that its last error is empty.
- For file-position replication, verify that the channel is consuming from the recorded coordinate and advancing.
- For GTID replication, compare the replica’s executed and received GTID sets with the source’s available history.
- Check that no relay-log recovery error remains, especially after a clone or a multithreaded file-position restore.
Data and workload checks
- Confirm that expected schemas, tables, users, and privileges from the snapshot exist.
- Check application-level consistency for data that must be restored together; replication status alone cannot detect every logical inconsistency in a backup.
- Keep scheduled events disabled until their post-restore behavior has been reviewed.
- Do not promote the server while GTID sets, replication errors, or application checks remain unresolved.
Why does a restored replica report missing GTIDs?
An ER_FOUND_MISSING_GTIDS error means the replacement is asking for transactions that are not available in the source history it can reach. The usual causes are an old snapshot, a source whose binary logs have expired, or a topology change that left the required transactions on another source.
Recovery choices
- Find another source that still contains the missing transactions and replicate them from that source, if the topology and transaction identity are compatible.
- Replace the replacement with a newer backup whose executed GTID set does not depend on purged history.
- Review binary-log retention, including
binlog_expire_logs_seconds, and adjust future retention so rebuilds do not outlive the available history. - Do not manufacture GTIDs or mark transactions executed merely to make the error disappear; doing so can hide missing data.
What does it mean when the replica has more GTIDs than the source?
ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE can appear after a source crash when transactions committed on a replica reached that replica but were not synchronized to the source’s binary log. The sets must be treated as evidence of possible divergence, not as a harmless startup warning.
Resolve divergence before continuing
- Stop and investigate which transactions exist only on the replica and whether they were committed by the application.
- Check whether the same GTID identifies different transaction contents on the source and replica; that is a conflict requiring manual resolution.
- If the data cannot be reconciled safely, remove either the source or the replica from the topology and rebuild it from a known-good state.
- Allow further writes only after the authoritative transaction history and the intended source of truth are clear.
What are the most common restore mistakes?
Starting replication during the import
Without --skip-replica-start, the applier can write to tables while a dump or physical copy is incomplete. Always import first, configure the channel second, and start replication last.
Recommended Free Tools
Using a current coordinate instead of the snapshot coordinate
A source log position observed after the backup does not identify the backup’s contents. File-position replication must use the exact file and position captured for that snapshot.
Mixing GTID and file-position instructions
GTID auto-positioning and manual log offsets are different recovery models. Follow the model already used by the topology; do not add SOURCE_AUTO_POSITION=1 to a channel that has not been designed and configured for compatible GTID operation.
Assuming a clone copied logs
Clone transfers transaction and replication metadata, but not binary-log or relay-log files. The recipient still depends on a source that can provide any transactions it lacks.
Also popular on Amazon
Editing metadata tables directly
Repository tables are not a supported substitute for CHANGE REPLICATION SOURCE TO. Manual edits can be overridden or leave the channel’s connection and applier state inconsistent.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsPromoting immediately after START REPLICA
A channel that reports running can still be behind, divergent, or logically inconsistent with the application’s expectations. Validate GTID or position progress, errors, and application data before promotion.
Which restore method should I choose?
Choose the method that matches the topology’s transaction identity and the evidence available for the backup. The following decision path avoids selecting a convenient method that cannot prove where the restored data belongs.
- Already using GTIDs and the source retains history? Restore a consistent snapshot with GTID information and use
SOURCE_AUTO_POSITION=1. - Using anonymous or file-position replication? Restore a snapshot with a recorded matching log file and position, then configure those exact values.
- Need rapid physical provisioning and have a compatible donor? Consider the clone plugin, while planning for the fact that logs themselves are not copied.
- Need portability or have no physical donor? Use a logical dump or raw backup, keeping the replica stopped during import.
- History is too large for a full replay? Use a snapshot plus the required binary logs and global transaction information, or an appropriate physical-backup workflow.
What is the final restoration checklist?
- The replacement starts with replication disabled.
- The imported snapshot is known to be consistent.
- Scheduled events are disabled or individually reviewed.
- The topology’s GTID or file-position mode is confirmed.
- File-position restores use the exact coordinate captured with the snapshot.
- GTID restores use compatible GTID modes, retained source history, and
SOURCE_AUTO_POSITION=1. - Connection parameters are set with
CHANGE REPLICATION SOURCE TO, not by editing metadata tables. START REPLICAis issued only after import and configuration succeed.- Receiver, applier, GTID or position progress, and last-error fields are checked.
- Missing or conflicting GTIDs are resolved before the server is trusted or promoted.
Frequently Asked Questions
Can I restore a MySQL replica if the original source is offline?
Yes, if the backup and transaction metadata are sufficient and another source retains every transaction the replacement needs. If no reachable source has the required file-position range or GTIDs, obtain a newer complete backup rather than starting the channel against an unrelated server.
What permissions does a restored MySQL data directory need?
The files must be owned and accessible by the operating-system account that runs the MySQL server. The exact account and permission mode depend on the installation method, so preserve the destination’s existing ownership pattern when extracting raw backup files.
Can I change from file-position replication to GTID during the rebuild?
Treat that as a topology conversion, not a routine restore. The source, replacement, and channel must be configured for compatible GTID modes and the snapshot must carry trustworthy GTID state; otherwise use the file and position model that existed when the backup was taken.
How can I avoid missing-GTID failures on the next rebuild?
Retain binary logs long enough to cover the oldest backup that might be used, and monitor binlog_expire_logs_seconds against that recovery window. Keep snapshot records with their GTID state or exact source coordinate so a replacement can request the correct history.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

