Initializing MGR Authentication Information
Log in to the MySQL databases (3306, 3307, and 3308) in the MGR group.
- Log in to the MySQL databases.
1 2 3
/usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqlm.sock /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls.sock /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysqls2.sock
- Create a replication account.
SET SQL_LOG_BIN=0; CREATE USER rpl_user@'%' IDENTIFIED BY '123456'; GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%'; GRANT BACKUP_ADMIN ON *.* TO rpl_user@'%'; FLUSH PRIVILEGES; SET SQL_LOG_BIN=1;
SET SQL_LOG_BIN=0; indicates that all operations in the current session are not recorded in bin_log.
- Set the username and password for authentication.
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='123456' FOR CHANNEL 'group_replication_recovery';
- Stop the MySQL database.
shutdown;
- Start the database for the MGR configuration to take effect.
1 2 3
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf-master-mgr & /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf-slave-mgr & /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf-slave-2-mgr &
After all MGR authentication information is initialized, restart the MySQL database for the MGR configuration to take effect.
Parent topic: Deploying MGR (Single-Primary Mode)