Sam's Tech Blog

You can check out any time you like, But you can never leave!'

2019-08-21

MySQL master to master replication

How to: MySQL master to master replication

MySQL master to master replication

On all servers:

create user 'replicator'@'%' identified by 'R2pl1cap0rISH3r1';
grant replication slave on *.* to 'replicator'@'%'; 

On slaves:

slave stop; 

CHANGE MASTER TO MASTER_HOST = '192.168.14.14', MASTER_USER = 'replicator', MASTER_PASSWORD = 'iyGHzzxjp5Upls9fgemZ', MASTER_LOG_FILE = 'mariadb-bin.000079', MASTER_LOG_POS = 88928598; 

slave start;