Solved

Trying to set up MySQL Replication

Posted on 2016-07-20
3
81 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 50

Accepted Solution

by:
Steve Bink earned 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now