开启ntpd
systemctl start ntpd 从服务器同步主服务器时间vi /etc/ntp.conf
添加主服务器ip,并注释
server 主服务器ip
主服务器mysql配置修改配置文件
vi /etc/my.conf
重启mysqlsystemctl restart mysqld 给从服务器权限grant replication slave on . to 'myslave'@'43.248.136.%' identified by '1234';
配置从服务器并重启vi /etc/my.conf
登录mysql配置主从同步change master to master_host='43.248.136.97',master_user='myslave',master_password='1234',master_log_file='master-bin.000001',master_log_pos=154;
start slave;
show slave status\G;