- 代码片段
ALTER USER 'root'@'%' IDENTIFIED BY 'password';
CREATE USER 'slave1'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'slave1'@'%';
change master to master_host='192.168.0.1',master_user='slave1',master_password='password',master_log_file='mysql-bin.000001',master_log_pos=751;
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "password";