


Introduction to the process of how to implement dual-master synchronization of partial tables in MySQL5.7
This article mainly introduces to you the relevant information about the implementation of some tables of dual-master synchronization in MySQL 5.7. The article introduces it in detail through the example code. It has certain reference learning value for everyone to learn or use mysql. Friends who need it Let’s learn with the editor below.
Preface
Recently encountered a demand. Due to the company's own business, some tables between the two databases need real-time bidirectional data synchronization. And the downtime of any one of the databases will not affect the other database. Record your own technical research here for later use in reconstruction. Not much to say below, let’s take a look at the detailed introduction.
Install MySQL5.7
It is recommended to go directly to the official website and download the yum source to install, after all, it is safe and easy to install.
1 2 3 4 5 6 |
|
Configuring dual master
my.cnf configuration
This is just a simple dual master The configuration has not been optimized in database-related aspects. If optimization is needed, you can chat privately.
The configuration of MySQL1 is as follows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
The configuration of MySQL2 is basically the same as above, just modify one server-id=2
, keep the others unchanged
MySQL command configuration
The following are all configured in the SQL command line interface
Main configuration:
1 2 3 4 5 6 7 8 9 10 |
|
From configuration:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
The same configuration can be done on MySQL2
Dual master Synchronous test
#Here I have previously built a ziyun database on both sides, and built the test1 test2 test3 table. The test results are as follows:
Summarize
The above is the detailed content of Introduction to the process of how to implement dual-master synchronization of partial tables in MySQL5.7. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





Generally speaking, we only need to use one of the headphones or speakers at the same time. However, some friends have reported that in the win11 system, they encountered the problem of headphones and speakers sounding at the same time. In fact, we can turn it off in the realtek panel and it will be fine. , let’s take a look below. What should I do if my headphones and speakers sound together in win11? 1. First find and open the "Control Panel" on the desktop. 2. Enter the control panel, find and open "Hardware and Sound" 3. Then find the "Realtek High Definition" with a speaker icon. Audio Manager" 4. Select "Speakers" and click "Rear Panel" to enter the speaker settings. 5. After opening, we can see the device type. If you want to turn off the headphones, uncheck "Headphones".

When you find that one or more items in your sync folder do not match the error message in Outlook, it may be because you updated or canceled meeting items. In this case, you will see an error message saying that your local version of the data conflicts with the remote copy. This situation usually happens in Outlook desktop application. One or more items in the folder you synced do not match. To resolve the conflict, open the projects and try the operation again. Fix One or more items in synced folders do not match Outlook error In Outlook desktop version, you may encounter issues when local calendar items conflict with the server copy. Fortunately, though, there are some simple ways to help

MySQL is a very popular open source relational database management system that is widely used in various web applications, enterprise systems, etc. In modern business application scenarios, most MySQL databases need to be deployed on multiple servers to provide higher availability and performance, which requires MySQL data migration and synchronization. This article will introduce how to implement MySQL data migration and synchronization between multiple servers. 1. MySQL data migration MySQL data migration refers to the data migration in the MySQL server.

A very useful function of win10 clipboard is the cross-device cloud storage function, which is very useful and can help users copy and paste simultaneously on PC devices and mobile devices. The setting method is very simple, just set it on the clipboard in the system. Synchronize win10 clipboard to mobile phone 1. First click Start in the lower left corner to enter settings. 2. Then click "System". 3. Select "Clipboard" on the left. 4. Finally, click Login in "Cross-device synchronization" on the right, and then select your mobile phone.

The OneDrive app on your system stores all your files and folders in the cloud. But sometimes users don't want certain files or folders to be stored and take up OneDrive space that is limited to 5 GB without a subscription. To do this, there is a setting in the OneDrive app that allows users to select files or folders to sync on the cloud. If you are also looking for this, then this article will help you select folders or files to sync in OneDrive on Windows 11. How to select certain folders to sync in OneDrive in Windows 11 Note: Make sure the OneDrive app is connected and synced

How to synchronize Baidu Cloud Sync Disk? You can select files to synchronize in Baidu Cloud Sync Disk, but most users don’t know how to synchronize Baidu Cloud files. Next is the graphic tutorial of Baidu Cloud Sync Disk synchronization method brought by the editor for users. Interested users come and take a look! How to synchronize Baidu Cloud Sync Disk 1. First enter the computer desktop, right-click the [Baidu Cloud Sync Disk] icon and select [Settings]; 2. Then expand the service window, switch to the [Advanced Settings] page and click [Select Folder]; 3. Finally switch to the page as shown below, check the files that need to be synchronized and click [OK].

Locks and Synchronization in Concurrent Programming In concurrent programming, multiple processes or threads run simultaneously, which can lead to resource contention and inconsistency issues. To solve these problems, locks and synchronization mechanisms are needed to coordinate access to shared resources. Concept of Lock A lock is a mechanism that allows only one thread or process to access a shared resource at a time. When one thread or process acquires a lock, other threads or processes are blocked from accessing the resource until the lock is released. Types of locks There are several types of locks in python: Mutex lock (Mutex): ensures that only one thread or process can access resources at a time. Condition variable: Allows a thread or process to wait for a certain condition and then acquire the lock. Read-write lock: allows multiple threads to read resources at the same time, but only allows one thread to write resources

Key concepts of C++ multi-thread synchronization: Mutex lock: ensure that the critical section can only be accessed by one thread. Condition variables: Threads can be awakened when specific conditions are met. Atomic operation: A single uninterruptible CPU instruction ensures the atomicity of shared variable modifications.
