
思路:主库开启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 that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8
# The defaul

本文介绍了如何在Windows和CentOS环境下配置MySQL主从复制,包括主库my.ini配置、从机my.cnf配置,以及主从数据同步的步骤,旨在实现数据库实时备份和保证数据完整性。
最低0.47元/天 解锁文章
1201

被折叠的 条评论
为什么被折叠?



