grant replication slave on *.* to ‘repdcssub‘@‘192.168.191.112‘ identified by ‘123456‘;
grant all privileges on *.* to ‘repdcssub‘@‘192.168.191.112‘ identified by ‘123456‘
mysql -h192.168.191.113 -urep -p123456
mysqldump --master-data 这样可以在从上还原,
建立同步用户(主从)
grant replication slave on *.* to ‘repdcs‘@‘192.168.191.110‘ identified by ‘123456‘;
grant all privileges on *.* to ‘repdcs‘@‘192.168.191.110‘ identified by ‘123456‘;
FLUSH PRIVILEGES;
mysql> show master status;
FLUSH PRIVILEGES;
从库配置my.cnf
[root@ligangtest u02]# more /etc/my.cnf
[mysqld]
datadir=/u02/ligangdata
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
character-set-server=utf8