mysql双主同步配置文件_配置MySQL数据库的主从同步(双主) | Byrd's Weblog

[root@Master-Mysql ~]# /usr/local/mysql/bin/mysql -uroot -p'' < /tmp/192.168.199.178.sql #如果主、从一致非必须

mysql> update mysql.user set password=PASSWORD('admin') where user='root';

[root@Master-Mysql ~]# cat |/usr/local/mysql/bin/mysql -uroot -p'admin' <

> CHANGE MASTER TO

> MASTER_HOST='192.168.199.178',

> MASTER_PORT=3306,

> MASTER_USER='byrd',

> MASTER_PASSWORD='admin',

> MASTER_LOG_FILE='mysql-bin.000004',

> MASTER_LOG_POS=120;

> EOF

mysql> start slave;

mysql> show slave status\G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.199.178

Master_User: byrd

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000004

Read_Master_Log_Pos: 938

Relay_Log_File: mysqld-relay-bin.000002

Relay_Log_Pos: 1101

Relay_Master_Log_File: mysql-bin.000004

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Last_Errno: 0

Skip_Counter: 0

Exec_Master_Log_Pos: 938

Relay_Log_Space: 1275

Until_Condition: None

Until_Log_Pos: 0

Master_SSL_Allowed: No

Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_SQL_Errno: 0

Master_Server_Id: 2

Master_UUID: 34d672c3-d292-11e3-9ff5-00155dc7834c

Master_Info_File: /usr/local/mysql/data/master.info

SQL_Delay: 0

SQL_Remaining_Delay: NULL

Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

Master_Retry_Count: 86400

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值