Mysql修改server uuid

问题来源:如果从服务器是克隆的主服务器,那么server-uuid的值肯定是一样的,不然后面主从复制报错误1593,修改以后重启mysql

1.首先要查找到mysql的安装地址

mysql> show variables like 'datadir';
+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| datadir       | /var/lib/mysql/ |
+---------------+-----------------+
1 row in set (0.03 sec)
//然后通过mysql生成一个uuid机型记录等会用于修改
mysql> select uuid();
+--------------------------------------+
| uuid()                               |
+--------------------------------------+
| 91d15a5a-9f05-11e9-a8c7-0242ac110002 |
+--------------------------------------+

2.然后进入datadir目录

cd /var/lib/mysql/
vi auto.cnf
//修改server-uuid

3.重启mysql

service mysqld restart 

你可能感兴趣的:(linux,mysql)