win下maridb 10.1.8下主从复制配置
Posted alantop的笔记
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了win下maridb 10.1.8下主从复制配置相关的知识,希望对你有一定的参考价值。
主库配置
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下主从复制配置的主要内容,如果未能解决你的问题,请参考以下文章