标签:cti 查看 修改 min yum serve set art 服务器
两台机器ip分别为
100.100.100.105 (主)
100.100.100.106(从)
安装 mysql
[root@centos ~]# yum install mysql-server mysql-client -y
[root@centos ~]# service mysqld start
[root@centos ~]# /usr/bin/mysqladmin -u root password '123456'
[root@centos ~]# vim /etc/my.cnf
log-bin=mysql-bin
server-id=105
[root@centos ~]# vim /etc/my.cnf
log-bin=mysql-bin
server-id=106
mysql> grant replication slave on *.* to slave@'100.100.100.106' identified by '123456';
mysql> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000004 | 261 | | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
change master to
master_user='slave',
master_password='123456',
master_host='100.100.100.105',
master_log_file='mysql-bin.000004',
master_log_pos=261;
mysql> start slave;
mysql> show slave status\G;
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
标签:cti 查看 修改 min yum serve set art 服务器
原文地址:https://www.cnblogs.com/hjnzs/p/12200670.html