MYSQL database GTID realizes master-slave replication (super convenient)

MYSQL database GTID realizes master-slave replication (super convenient)

1. Add Maria source

vi /etc/yum.repos.d/MariaDB.repo

Paste the latest mariadb image from Alibaba Cloud:

[mariadb]
name = MariaDB
baseurl = https://mirrors.aliyun.com/mariadb/yum/10.5/centos7-amd64/
gpgkey=https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

Install the new version of MariaDB

yum install mariadb mariadb-server

Enable binlog

vim /etc/my.cnf.d/server.cnf

Add the following under mysqld server_id = 1
log_bin = mysql-bin

systemctl restart mariadb

insert image description here

2. Master-Slave Replication

1. Authorize on the master

grant replication slave on *.* to 'slave'@'192.168.59.%' identified by '123';

insert image description here

2. Add a host and perform synchronization master operation

Stop slave, stop synchronization, and start modifying information stop slave;
Write the master information CHANGE MASTER TO
  -> MASTER_HOST='192.168.59.143',
  -> MASTER_USER='slave',
  -> MASTER_PASSWORD = '123',
  -> MASTER_PORT=3306,
  ->MASTER_USE_GTID = current_pos;

 Start slave and start synchronization start slave;

insert image description here

Verify whether

show slave status \G;

insert image description here

At this point, GTID master-slave replication is completed! !

This is the end of this article about MYSQL database GTID master-slave replication implementation (super convenient). For more relevant MYSQL GTID master-slave replication content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed introduction to GTID mode of MySQL master-slave replication
  • Solution to the problem that synchronous replication errors cannot be skipped in MySQL5.6 GTID mode
  • An example of changing traditional replication to GTID replication without stopping business in MySQL 5.7
  • Detailed explanation of MySQL master-slave replication practice - GTID-based replication
  • MySQL 5.6 master-slave replication based on GTID
  • Tutorial on using GTIDs replication protocol and outage protocol in MySQL
  • Specific use of GTID replication in MySQL replication

<<:  A complete list of meta tag settings for mobile devices

>>:  Detailed explanation of the watch listener example in vue3.0

Recommend

Comprehensive summary of Vue3.0's various listening methods

Table of contents Listener 1.watchEffect 2.watch ...

Solve the problem of IDEA configuring tomcat startup error

The following two errors were encountered when co...

Vue implements partial refresh of the page (router-view page refresh)

Using provide+inject combination in Vue First you...

Comprehensive understanding of html.css overflow

Comprehensive understanding of html.css overflow ...

Detailed explanation of the construction and use of docker private warehouse

1. Download the repository image docker pull regi...

js implements the algorithm for specifying the order and amount of red envelopes

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

How to Rename Multiple Files at Once in Linux

Preface In our daily work, we often need to renam...

Tutorial on installing Android Studio on Ubuntu 19 and below

Based on past experience, taking notes after comp...

How to implement the paging function of MyBatis interceptor

How to implement the paging function of MyBatis i...

Example of using @media responsive CSS to adapt to various screens

Definition and Use Using @media queries, you can ...

Vue method to verify whether the username is available

This article example shares the specific code of ...