码迷,mamicode.com
首页 > 数据库 > 详细

win下maridb 10.1.8下主从复制配置

时间:2019-09-28 23:07:40      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:option   ack   复制配置   主从复制   use   enc   ica   成功   tables   

主库配置

server_id=1
read-only=0
replicate-do-db=mydata
log-bin=mysql-bin

主库权限设置

GRANT replication slave ON *.* TO‘backup‘@‘%‘ identified BY ‘password‘;

flush PRIVILEGES;

GRANT EXECUTE, SELECT, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EVENT, INDEX, INSERT, REFERENCES, TRIGGER, UPDATE, LOCK TABLES ON `mydata`.* TO ‘backup‘@‘%‘ WITH GRANT OPTION
FLUSH PRIVILEGES;

show master status

从库配置:

server_id=2
read-only=1
replicate-do-db=mydata
log-bin=mysql-bin

change master to MASTER_HOST=‘172.20.42.224‘, MASTER_USER=‘backup‘,MASTER_PASSWORD=‘password‘, MASTER_LOG_FILE=‘mysql-bin.000085‘,MASTER_LOG_POS=839, master_connect_retry=60,MASTER_PORT=3307

注意点:mysql-bin.000085 和 839 这2个参数来自主库show master status的查询。

stop SLAVE

START slave

SHOW SLAVE status

这三个状态 slave_IO_state、slave_IO_running、slave_SQL_running 是yes,配置成功。

win下maridb 10.1.8下主从复制配置

标签:option   ack   复制配置   主从复制   use   enc   ica   成功   tables   

原文地址:https://www.cnblogs.com/alantop/p/11605233.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!