mysql8.0.20 部署主从复制
master庫:192.168.1.25
mysql -e "reset master;" mysql -e "create user ‘192.168.1.%‘ ; grant replication slave on *.* to ‘192.168.1.%‘;" ALTER USER ‘192.168.1.%‘ IDENTIFIED WITH mysql_native_password BY ‘OrcSdk21TbUserUi‘;FLUSH PRIVILEGES; mysqldump -uroot -p‘rRt&8v7Cx‘ -B -A -F --set-gtid-purged=OFF --master-data=2 --single-transaction --events|gzip >/opt/test_$(date +%F).sql.gz
slave库1:192.168.1.182
mysql < /opt/test_2020-05-28.sql mysql -e "CHANGE MASTER TO MASTER_HOST=‘mysql-redis25‘,MASTER_PORT=3306,MASTER_USER=‘repuser‘,MASTER_PASSWORD=‘OrcSdk21TbUserUi‘,MASTER_AUTO_POSITION = 1;start slave;show slave status\G" |grep -i "yes"
slave库2:192.168.1.39
mysql < /opt/test_2020-05-28.sql mysql -e "CHANGE MASTER TO MASTER_HOST=‘mysql-redis25‘,MASTER_PORT=3306,MASTER_USER=‘repuser‘,MASTER_PASSWORD=‘OrcSdk21TbUserUi‘,MASTER_AUTO_POSITION = 1;start slave;show slave status\G" |grep -i "yes"
报错2061
在show slave status\G 报错2061的原因:
mysql8.0 开始默认的加密方式和解密方式和传统的mysql5.7 mysql5.6是有区别的,具体自行百度查看。
解决办法就是在master库机器192.168.1.25 机器alter重新创建create 账户
ALTER USER ‘192.168.1.%‘ IDENTIFIED WITH mysql_native_password BY ‘OrcSdk21TbUserUi‘;FLUSH PRIVILEGES;
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11