Mysql主從複製報錯:The slave I/O ... master and slave have equal MySQL server UUID解決

問題描述

一主一從mysql架構,在啓動slave後 show slave status\G 報錯The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.mysql

uuid相同,想到本身用的slave虛擬機是克隆了Mater的虛擬機,因此裏面的各項配置都同樣sql



問題解決

先找到 mysql 的 auto.cnf文件vim

sudo find / -name 'auto.cnf'複製代碼


sudo vim /var/lib/mysql/auto.cnf複製代碼

能夠先在mysql中生成一個uuidbash


而後複製到 auto.cnf架構


重啓mysql服務
systemctl restart mysql複製代碼


再次查看slave狀態  show slave status\G ui

相關文章
相關標籤/搜索