6 MySQL 同步
同步功能在MySQL
3.23.15就开始引进了,它可以把一个MySQL服务器上的数据复制到另一个服务器上去。本章描述了MySQL的各种复制特性。介绍了同步的概念,如何设置同步服务器,以及可用服务器的参照。还提供了一系列的常见问题及其答案,疑难解答。
"14.6 Replication Statements"中介绍了同步相关的SQL语句语法。
我们建议经常访问"http://www.mysql.com"经常阅读本章的最新内容。同步功能一直在改进,我们经常把这部分的手册更新到当前的最新内容。
6.1 同步介绍
MySQL
3.23.15及更高的版本支持单向同步。一个服务器作为master(主服务器),一个或者多个服务器作为slave(从服务器)。master服务器把更新的内容写到二进制日志(binary
log或binlog)中,并且维护了一个索引文件来记录日志循环的情况。这些日志中的更新部分会被发送到slave服务器。一个slave连接到master之后,它通知master最后一次成功增量更新的日志位置。slave会找出所有从那个时刻开始的更新操作,然后阻塞并等待master发送新的更新操作。
如果想要做一个同步服务器链的话,slave同时也可以作为master。
注意,启用同步后,所有要同步的更新操作都必须在master上执行。否则,必须注意不要造成用户在master上的更新和在slave上的更新引起冲突。
单向同步的好处是稳健,高速,系统易管理:
有了master/slave机制后,就更稳健了。当master上发生问题时,可以把slave作为备用切换过去。

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

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
