标签:nbsp mysq position highlight slave 主从同步 master lang weight
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
安装命令:yum install mysql-server 启动msyql:systemctl start mysqld
grep ‘temporary password‘ /var/log/mysqld.log
set global validate_password_policy=0; set global validate_password_length=1;
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123456‘;
vim /etc/my.cnf
log-bin=mysql-bin server-id=102
show master status;
CREATE USER ‘slave‘@‘192.168.0.103‘ IDENTIFIED BY ‘slave‘;#创建用户 GRANT REPLICATION SLAVE ON *.* TO ‘slave‘@‘192.168.0.103‘;#分配权限 flush privileges; #刷新权限
vim /etc/my.cnf
server-id=103
CHANGE MASTER TO MASTER_HOST=‘192.168.0.102‘, MASTER_USER=‘slave‘, MASTER_PASSWORD=‘slave‘, MASTER_LOG_FILE=‘mysql-bin.000001‘, MASTER_LOG_POS=773;
start slave;
show slave status\G;
Slave_IO_Running: Yes Slave_SQL_Running: Yes
标签:nbsp mysq position highlight slave 主从同步 master lang weight
原文地址:https://www.cnblogs.com/advanceBlog/p/12231565.html