?
Solved

Trying to set up MySQL Replication

Posted on 2016-07-20
3
Medium Priority
?
322 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
  • 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

In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Exchange database can often fail to mount thereby halting the work of all users connected to it. Finding out why database isn’t mounting is crucial and getting the server back online. Stellar Phoenix Mailbox Exchange Recovery is a champion product t…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

612 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