克隆虚拟机 导致mysql uuid 重复
date
May 12, 2022
slug
克隆虚拟机导致mysql uuid重复
status
Published
tags
mac os
summary
克隆虚拟机导致mysql uuid重复
type
Post
error 1
Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
克隆虚拟机 导致mysql uuid 重复
主
root@ubuntu:~# cat /var/lib/mysql/auto.cnf
[auto]
server-uuid=6ab36d15-567e-11eb-9966-000c294b0e71
从
root@ubuntu:~# cat /var/lib/mysql/auto.cnf
[auto]
server-uuid=6ab36d15-567e-11eb-9966-000c294b0e71
解决方案
root@ubuntu:/var/lib/mysql# mv auto.cnf auto.cnf.bak
root@ubuntu:/var/lib/mysql# systemctl restart mysql.service
root@ubuntu:/var/lib/mysql# cat auto.cnf
[auto]
server-uuid=01ac855b-5684-11eb-ac01-000c294efaad
master 修改
root@ubuntu:~# cat /var/lib/mysql/auto.cnf
[auto]
server-uuid=6ab36d15-567e-11eb-9966-000c294b0e71
root@ubuntu:~# mv /var/lib/mysql/auto.cnf /var/lib/mysql/auto.cnf.bak
root@ubuntu:~# systemctl restart mysql.service
root@ubuntu:~# cat /var/lib/mysql/auto.cnf
[auto]
server-uuid=67ccd7f3-5684-11eb-8464-000c2950e5de
error 2
Last_IO_Error: error connecting to master 'admin@192.168.1.133:3306' - retry-time: 60 retries: 1 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
error 3
Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).