master and slave have equal MySQL server UUIDs solution

  • 2020-05-30 21:12:46
  • OfStack

A large amount of mysql is configured with rsync, which saves a lot of time for compilation and configuration. After modifying my. cnf of master and slave servers one by one, it is found that the data cannot be synchronized.
At slave server show slave status:

Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.

First check:
mysql > show variables like 'server_id';
+ - - - - - + - +
| Variable_name | Value |
+ - - - - - + - +
| server_id | 3 |
+ - - - - - + - +

Master and slave are not the same, eliminate the problem.

Continue the search and find out the reason is that, copy the entire data directory and copy the auto.cnf file as well, which records the uuid of the database. The uuid of each library should be different.

[auto]
server-uuid=6dcee5be-8cdb-11e2-9408-90e2ba2e2ea6

To solve the problem, follow the hexadecimal format, change it at will, and restart mysql.


Related articles: