mysql5.1 64bit 主从配置命令
发布时间:2014年10月15日 22时01分编辑:水木神风
telnet ip 3306 错误解决办法:
UPDATE mysql.user SET Host='%' WHERE Host='localhost';
GRANT ALL PRIVILEGES ON *.* TO root@"%" ;
FLUSH PRIVILEGES;
#mysql主从设置配置 主库
server-id = 1
log-bin=mysql-bin
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = econsume
binlog_ignore_db = mysql
#授予从库权限
GRANT REPLICATION SLAVE ON *.* TO 'slave58'@'172.18.0.58' identified by '123456';
FLUSH PRIVILEGES;
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO slave58@'172.18.0.58' IDENTIFIED BY '123456';
flush tables with read lock;
show master status\g
#mysql主从设置配置 从库
change master to master_host='172.18.0.52',master_user='slave58',master_password='123456',master_log_file='mysql-bin.000006' ,master_log_pos=106;
server-id=2
log-bin=mysql-bin
master-host=172.18.0.52
master-user=slave58
master-password=123456
master-port=3306
replicate-do-db=econsume
replicate-ignore-db=mysql
master-connect-retry=60
stop slave;
reset slave;
start slave;
SHOW SLAVE STATUS\G
关键字词:Mysql5.1 主从