The MySQL replication slave cannot initialize the relay log info repository, stopping replication from starting.
MySQL error 1872 ER_SLAVE_RLI_INIT_REPOSITORY occurs when a replication slave fails to create or load its relay-log-info repository. Recreate the missing tables or files, reset the slave, and restart replication to fix the issue.
ER_SLAVE_RLI_INIT_REPOSITORY
Error 1872 is raised by a MySQL replication slave that cannot build or read the internal relay log info repository introduced in MySQL 5.7.2. Without this structure, the slave IO and SQL threads refuse to start, halting replication.
The repository can live in a file or in two internal tables (mysql.slave_relay_log_info and mysql.slave_worker_info). If either storage method is missing or corrupted, MySQL throws this error during START SLAVE or server startup.
Replication lag grows immediately because the slave stops processing relay logs. Applications that rely on read scaling or high availability lose redundancy. Ignoring the issue risks data drift and prolonged downtime.
Missing mysql.slave_relay_log_info and mysql.slave_worker_info tables prevent the slave from persisting relay log positions in TABLE mode.
Incorrect file permissions or an invalid path keep the server from creating the relay-log-info file in FILE mode.
A previous crash can corrupt the repository tables or the relay-log-info file, making them unreadable on restart.
Changing relay_log_info_repository or transaction_write_set_extraction without recreating the repository also triggers the error.
Confirm which repository type your server expects and recreate the missing structure. Then restart replication and verify position consistency.
TABLE repository missing after upgrade - create the tables with mysql_upgrade or manually with the provided DDL, then run START SLAVE.
FILE repository path invalid - update relay_log_info_file or fix permissions, remove damaged file, and start the slave to generate a new one.
Crash-induced corruption - reset the slave, purge relay logs, and let the master resend data.
Automate mysql_upgrade after every version upgrade to create any new replication tables.
Store repository tables on durable storage and back them up with the data directory.
Monitor SHOW SLAVE STATUS and error logs for early warnings about repository problems.
Error 1201 HY000: Could not find target log during relay log initialization - usually follows error 1872 when relay logs are missing.
Error 1874 ER_REPLICA_FAILED_TO_CREATE_LOG - indicates failure to create relay log files, often tied to permission issues.
The tables mysql.slave_relay_log_info and mysql.slave_worker_info do not exist because mysql_upgrade was skipped.
The relay-log-info file cannot be created in the configured directory because MySQL lacks write permissions or the path is wrong.
A sudden shutdown corrupted the existing repository files or tables, making them unreadable.
relay_log_info_repository was changed from FILE to TABLE or vice versa without rebuilding the repository.
Raised when the replica cannot find the specified binlog on the master. Often follows repository issues.
Occurs when the slave fails to create relay logs, typically because of disk space or permission problems.
Thrown when multiple replication channels conflict; may appear alongside repository initialization failures.
No. If you recreate the repository tables or file and positions are intact, you can usually START SLAVE without a full rebuild.
RESET SLAVE ALL deletes replication metadata and relay logs but leaves existing database data untouched.
Galaxy's integrated error surfacing highlights relay log issues in real time and offers AI-generated fixes, reducing troubleshooting time.
The repository was introduced in 5.7.2, but the error can appear in all later versions, including MySQL 8.x.