//mysql8.0之前版本。设置主库
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
//mysql8.0以及之后版本。设置主库
create user 'root'@'%'identified by '123456';
grant all privileges on *.* to 'root'@'%' with grant option;
//mysql设置从库
change master to master_host='192.168.100.1',master_user='root',master_password='123456',master_log_file='mysql-bin.000016',master_log_pos=5555;