Workshop

The quiz and exercises are provided to help you solidify your understanding of the material covered today. Try to understand the quiz and exercise answers before continuing to tomorrow's lesson.

Quiz

1:

True or False: A master can have any number of slaves.

A1: True.
2:

True or False: A slave can have any number of masters.

A2: False. A slave can have only one master at a time. In fault-tolerant setups you may want to reconfigure a slave to get data from a new master.

Exercises

1:Write a GRANT query to be run on a master that allows a slave to connect from IP address 100.11.22.33 with username harry and password hpass23.
A1: You should have this:
mysql> GRANT REPLICATION SLAVE ON *.* TO harry@100.11.22.33
    -> IDENTIFIED BY 'hpass23';
									

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.