?
Solved

Trying to set up MySQL Replication

Posted on 2016-07-20
3
Medium Priority
?
233 Views
Last Modified: 2016-07-21
I do the following on both servers:
mysql>CREATE USER 'replicator'@'%' IDENTIFIED BY 'some_pass';
mysql>Grant all privileges on *.* to replicator@'%' with grant option;

Open in new window


Then I do the following on the master:
mysqluc> mysqlreplicate --master='replicator'@192.168.92.130:3306 --slave='replicator'@192.168.92.131:3306 --rpl-user replicator:some_pass
WARNING: Using a password on the command line interface can be insecure.
# master on 192.168.92.130: ...
ERROR: Access denied for user 'replicator'@'mysql-1-PC.localdomain' (using password: NO)

Open in new window


I thought 'replicator'@'%' would have access from all hosts?
0
Comment
Question by:itnifl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
Steve Bink earned 2000 total points
ID: 41722116
When you set up replication, you are connecting to master and slave individually, as indicated by the --master and --slave command line options.  Both of those options lack the password to connect.
0
 
LVL 2

Author Comment

by:itnifl
ID: 41722230
OK, thanks. Now I did this:
mysqluc> mysqlreplicate --master='replicator:some_pass'@192.168.92.130:3306 --slave='replicator:some_pass'@192.168.92.131:3306 --rpl-user replicator:some_pass
WARNING: Using a password on the command line interface can be insecure.
# master on 192.168.92.130: ... connected.
# slave on 192.168.92.131: ... connected.
# Checking for binary logging on master...
# Setting up replication...
ERROR: failed to sync slave with master.
ERROR: Cannot setup replication.

Open in new window


In the logs, I see this:

Timestamp, Thread, Type, Details
2016-07-21T07:22:16, 3, Note, Aborted connection 3 to db: 'unconnected' user: 'replicator' host: 'mysql-2-PC' (Got an error reading communication packets)
2016-07-21T07:22:16, 4, Note, Aborted connection 4 to db: 'unconnected' user: 'replicator' host: 'mysql-2-PC' (Got an error reading communication packets)
2016-07-21T07:22:26, 2, Note, Aborted connection 2 to db: 'unconnected' user: 'replicator' host: 'mysql-1-PC.localdomain' (Got an error reading communication packets)
2016-07-21T07:23:16, 5, Note, Aborted connection 5 to db: 'unconnected' user: 'replicator' host: 'mysql-2-PC' (Got an error reading communication packets)
2016-07-21T07:24:16, 8, Note, Aborted connection 8 to db: 'unconnected' user: 'replicator' host: 'mysql-2-PC' (Got an error reading communication packets)
0
 
LVL 2

Author Comment

by:itnifl
ID: 41722831
Seems like replicator@192.168.1.131 gets auto created at the master when mysqlreplicate is executed. It ignores replicator@'%'. This user replicator@192.168.1.131 did not have sufficient access rights. Giving these enabled mysqlreplicate to finish the setup.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question