MySQL数据库主从复制基础命令参数 :
1. 从库配置 help change master to;
CHANGE MASTER TO
MASTER_HOST='10.0.0.11',
MASTER_USER='repl',
MASTER_PASSWORD='123',
MASTER_PORT=3306,
MASTER_LOG_FILE='mysql.000005',
MASTER_LOG_POS=596,
MASTER_CONNECT_RETRY=10;
2. 主\从库查询配置命令:
show master status;
show slave status;
start slave | stop slave;
3. 主库配置授权用户:
grant replication slave on *.* to repl@'10.0.0.%' identified by '123';
flush privileges;
4. 主库需要配置的参数 打开数据库配置文件 /etc/my.cnf
binlog_format=row
sync_binlog=1
expire_logs_days=30
log_bin=/data/logbin/mysql.bin
网友评论