[Linux服务器使用] Mysql修改server uuid

Mysql修改server uuid

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

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

3.重启mysql

service mysqld restart

你可能感兴趣的:(数据库,Linux服务器使用)