在主從複製的時候如果第二個虛擬機器是複製過去的,需要修改
https://blog.csdn.net/pratise/article/details/80413198
1. 首先要查詢到mysql的安裝地址
show variables like 'datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+
1 row in set (0.00 sec)
//然後通過mysql生成一個uuid進行記錄等會用於修改
select uuid()
+--------------------------------------+
| uuid() |
+--------------------------------------+
| 2674149f-5083-11e8-be4b-080027a1f331 |
+--------------------------------------+
2. 然後進入datadir目錄
cd /var/lib/mysql/
vi auto.cnf
//修改server-uuid
1
2
3
3.重啟mysql
service mysqld restart