配置MySQL数据库的主从同步(一主一从)

    Read

以前的文章有写过mysql的配置MySQL数据库的多实例,此次配置mysql的主从同步

一、主库开启BINLOG、server-id

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

备注:以上两个信息必须在[mysqld]模块下!!!SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

二、给从库授权


锁表前建立点数据:
SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

三、锁表、备份、解锁

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

备注:备份数据需要重新打开新窗口,不然锁表就自动失效;SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

四、主库导入到从库

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

五、从库配置信息


SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

六、启动从库同步

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

七、结果测试

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

八、状态查询

主库:

SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/

从库:


申明:本文由BYRD原创(基于Mysql5.6.16),未经许可禁止转载!SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/ SourceByrd's Weblog-https://note.t4x.org/database/configuration-mysql-master-slave/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
Byrd
  • by Published on July 8, 2014
  • 原文链接:https://note.t4x.org/database/configuration-mysql-master-slave/
Comments  2  Guest  0  Pingback  2
匿名

Comment

Anonymous

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: