给Mysql 配置主从时出现如下错误:The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work
整体错误如下:
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).
排查错误
-
分别在主从数据库中执行如下sql, 并必读两边的server_id 是否一样,一样则修改my.cnf设置成不一样:
show variables like '%server_id%';
-
分别在主从数据库中执行如下sql, 并必读两边的server_uuid 是否一样,如果一样则删除从数据库的数据目录下的auto.cnf:
show variables like '%uuid%'