思路:主库开启binlog日志,从库读取操作日志,同步执行。
主要作用:数据库实时备份,保证数据的完整性;
缺点:影响系统一定的性能
一、环境
一台电脑,win10,在VMware安装了centos6.8
win10电脑安装了mysql5.5,centos6.8安装了mysql5.7
二、配置步骤
2.1、主机【master】my.ini文件配置
[client]
port=3306
[mysql]
default-character-set=utf8
# SERVER SECTION
[mysqld]
server-id=1 #主机标示,整数
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.5/"
#Path to the database root
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
# The default character set