nerdexam
Oracle

1Z0-888 · Question #79

While attempting to set up a new replication slave on host '192.168.0.25' with the user 'replication', you encounter this error: ERROR 1218 (08S01): Error connecting to master: Host '192.168.0.25'…

The correct answer is A. Add the user [email protected] with the correct password to the master. MySQL uses account-based access control, and the master server must explicitly permit the replication user to connect from the slave's IP address. Since [email protected] doesn't exist on the master, the master rejects the connection - creating that account with GRANT…

Replication

Question

While attempting to set up a new replication slave on host '192.168.0.25' with the user 'replication', you encounter this error: ERROR 1218 (08S01): Error connecting to master: Host '192.168.0.25' is not allowed to connect to this MySQL server What should you do to resolve this error?

Options

  • AAdd the user [email protected] with the correct password to the master.
  • BEdit the DNS table on the master to include the domain name for the IP address of 192.168.0.25.
  • CEdit the my.ini file on the slave so that the master-host variable is equal to the IP address of the master, and restart the slave.
  • DAdd the user [email protected] with the correct password to the slave.

How the community answered

(27 responses)
  • A
    93% (25)
  • B
    4% (1)
  • C
    4% (1)

Explanation

MySQL uses account-based access control, and the master server must explicitly permit the replication user to connect from the slave's IP address. Since [email protected] doesn't exist on the master, the master rejects the connection - creating that account with GRANT REPLICATION SLAVE ON *.* TO 'replication'@'192.168.0.25' IDENTIFIED BY '...' on the master resolves it.

Why the distractors fail:

  • B is wrong because MySQL access control is IP/hostname-based at the account level, not DNS resolution - the error isn't a name lookup failure.
  • C is wrong because master-host on the slave controls which master to connect to, not whether the master allows the connection; the slave's config isn't the problem here.
  • D is the most tempting trap - replication accounts must be created on the master (where authentication happens), not the slave.

Memory tip: Think of it this way - the master is the gatekeeper. The slave knocks on the master's door, so the master's user table must have a key (replication@<slave-IP>) that fits. If the key doesn't exist on the master, the door stays shut regardless of what you configure on the slave.

Topics

#MySQL Replication#User Authentication#Master-Slave Setup#Grant Privileges

Community Discussion

No community discussion yet for this question.

Full 1Z0-888 Practice