mysql master-slave 主从 on centos6.3

 

mysql master-slave
 
 
[root@msyql1 yum.repos.d]# yum install mysql-server mysql-devel
[root@mysql2 yum.repos.d]# yum install mysql-server mysql-devel
 
[root@msyql1 yum.repos.d]# vi /etc/my.cnf
log-bin=mysql-bin
server-id=192
 
mysql> create user 'copy'@'192.168.160.129' identified by '123456'
    -> ;
Query OK, 0 rows affected (0.00 sec)
 
mysql> grant replication slave on *.* to 'cpoy'@'192.168.160.129' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
 
mysql>
mysql> show master status;
mysql> flush tables with read lock;
 
 
 
[root@mysql2 yum.repos.d]# mysql -ucopy -p -h 192.168.160.128
 
 
 
mysql> start slave;
mysql> show slave status\G;
 
 
 
 
 
 
 
 
 
 
 
 
 
 

你可能感兴趣的:(mysql,on,主从,centos6.3,master-slave)