Mysql Master Master Replication

2019-07-18 04:45发布

问题:

Server1: xxx.xxx.xxx.xxx

server-id=1 
binlog-do-db=sample 
master-host = xxx.xxx.xxx.xxx 
master-user = someuser 
master-password = somepassword 
master-connect-retry = 60 
relay-log = /var/lib/mysql/slave-relay.log 
relay-log-index = /var/lib/mysql/slave-relay-log.index 

Server 2: xxx.xxx.xxx.xxx

server-id=2 
binlog-do-db = sample 
master-host = xxx.xxx.xxx.xxx 
master-user = someuser 
master-password = somepassword 
master-connect-retry = 60 
relay-log = /var/lib/mysql/slave-relay.log 
relay-log-index = /var/lib/mysql/slave-relay-log.index 

I have setup the master master replication configuration on 2 test servers, i have also opened ports for both the mysql 3306 on servers i am facing a problem with slave connection I keep getting the

following errors 101021 19:12:23 [ERROR] Slave I/O: error connecting to master 'root@xxx.xxx.xxx.xxx:3306' - retry-time: 60 retries: 86400, Error_code: 1045

Sever 1 has mysql 5.0.77 and server 2 has mysql version 5.1.41

回答1:

Error_code: 1045 means that there is a problem with your credentials.

Try to connect with your replication user credentials like :

mysql -h host -u your_user -p your_password

Note that the password is limited to 32 characters.