Solved

Trying to set up MySQL Replication

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
powershell code to list items in dropdown 6 67
append to an ms access field 6 35
constraint check 2 44
two ways encryption with php 3 29
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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…

825 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