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

Dissecting the advantages of class over id when annotating HTML elements

There are very complex HTML structures in web pag...

Quickly solve the Chinese input method problem under Linux

Background: I'm working on asset reporting re...

Interpretation of 17 advertising effectiveness measures

1. 85% of ads go unread <br />Interpretatio...

JS code to achieve page switching effect

This article example shares the specific code of ...

Vue2.x responsiveness simple explanation and examples

1. Review Vue responsive usage​ Vue responsivenes...

Summary of clipboard.js usage

Table of contents (1) Introduction: (2) The ways ...

A magical MySQL deadlock troubleshooting record

background Speaking of MySQL deadlock, I have wri...

React diff algorithm source code analysis

Table of contents Single Node Diff reconcileSingl...

Installation tutorial of MySQL 5.7.17 zip package version under win10

The installation tutorial of mysql5.7.17 is share...

React non-parent-child component parameter passing example code

React is a JAVASCRIPT library for building user i...

Implementation of running springboot project with Docker

Introduction: The configuration of Docker running...

Summary of HTML horizontal and vertical centering issues

I have encountered many centering problems recent...

How to deploy Oracle using Docker on Mac

How to deploy Oracle using Docker on Mac First in...