mysql修改UUID

mysql修改UUID

问题描述:集群搭建时克隆主服务的镜像导致所有节点的服务UUID都一致,此时在集群中添加节点时会提示UUID冲突报错。

解决方案

1、利用uuid函数生成新的uuid

mysql> select uuid();
+--------------------------------------+
| uuid()                               |
+--------------------------------------+
| b33057ff-bec6-11eb-ad94-000c29af6856 |
+--------------------------------------+
1 row in set (0.00 sec)
2、查看配置文件目录

mysql> show variables like 'datadir';
+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| datadir       | /var/lib/mysql/ |
+---------------+-----------------+
1 row in set (0.03 sec)
3、编辑配置文件目录

vi /var/lib/mysql/auto.cnf
4、uuid修改新生成的uuid

server-uuid=b33057ff-bec6-11eb-ad94-000c29af6856
5、重启服务

service mysqld restart

你可能感兴趣的:(mysql,数据库,前端)