How to modify server uuid in Mysql

How to modify server uuid in Mysql

Source of the problem:

If the slave server is the cloned master server, then the value of server-uuid must be the same, otherwise the master-slave replication will report error 1593. After modification, restart MySQL

Let me introduce you to the relevant solutions below. Without further ado, let’s take a look at the detailed introduction.

Workaround

1. First, find the installation address of MySQL

show variables like 'datadir';

+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+
1 row in set (0.00 sec)

//Then generate a uuid through mysql for recording and will be used to modify select uuid()

+--------------------------------------+
| uuid() |
+--------------------------------------+
| 2674149f-5083-11e8-be4b-080027a1f331 |
+--------------------------------------+

2. Then enter the datadir directory

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

3. Restart mysql

service mysqld restart

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM.

You may also be interested in:
  • A brief analysis of whether MySQL primary key uses numbers or uuids for faster query
  • MySQL method of generating random numbers, strings, dates, verification codes and UUIDs
  • The difference and advantages and disadvantages of Mysql primary key UUID and auto-increment primary key
  • In-depth analysis of why MySQL does not recommend using uuid or snowflake id as primary key
  • How to remove horizontal lines when storing UUID in Mysql
  • Why does Mysql analyze and design table primary key not use uuid?

<<:  Detailed steps for Linux account file control management

>>:  Vue Element UI custom description list component

Recommend

Use of Linux ipcs command

1. Command Introduction The ipcs command is used ...

In-depth analysis of Flex layout in CSS3

The Flexbox layout module aims to provide a more ...

How to Understand and Identify File Types in Linux

Preface As we all know, everything in Linux is a ...

How to configure ssh/sftp and set permissions under Linux operating system

Compared with FTP, SSH-based sftp service has bet...

The difference between HTML iframe and frameset_PowerNode Java Academy

Introduction 1.<iframe> tag: iframe is an i...

How to obtain root permissions in a docker container

First, your container must be running You can vie...

A brief introduction to the simple use of CentOS7 firewall and open ports

Overview (official has more detailed description)...

js to achieve a simple magnifying glass effect

This article shares the specific code of js to ac...

Two solutions for automatically adding 0 to js regular format date and time

Table of contents background Solution 1 Ideas: Co...

Detailed explanation of Promises in JavaScript

Table of contents Basic usage of Promise: 1. Crea...

How to use binlog for data recovery in MySQL

Preface Recently, a data was operated incorrectly...

Calculation of percentage value when the css position property is absolute

When position is absolute, the percentage of its ...

Detailed explanation of MySQL alter ignore syntax

When I was at work today, the business side asked...