Is MySQL giving you the error message “ERROR 1200 (HY000): The server is not configured as replica; fix in config file or with CHANGE MASTER TO” when you try to run START SLAVE? There are a few simple troubleshooting steps to take, but I always forget what to do. This article is to help me remember in the future!
- First, make sure you have run CHANGE MASTER TO and configured the server as a replica. If you’ve done this, you should get some output from SHOW SLAVE STATUS. If so, go to the next step.
- Next, make sure you have set a server ID on both the master and the replica. Try running
SHOW VARIABLES LIKE 'server_id'on both servers. If the value is zero or one, check the configuration file for an explicit setting, because zero or one is often the default value when nothing is specified. I have seen this cause the replica to fail, even in cases where the master’s ID is 1, which ought to work okay but sometimes doesn’t.
- Finally, make sure your master and replica have different server IDs (on small networks, I usually set the server ID to the last octet in the server’s IP address, because it’s handy and easy to remember). MySQL replicas will refuse to replicate from a master with the same ID.
You should now be able to run START SLAVE and start your replica replicating from the master.
Did I miss anything? Let me know, and I’ll add it!