0
0
MySQLquery~20 mins

Replication basics in MySQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Replication Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1:30remaining
Identify the Master Server Status
Given the output of SHOW MASTER STATUS; on a MySQL server, what does the File column represent?
MySQL
SHOW MASTER STATUS;
AThe name of the binary log file currently being written by the master.
BThe name of the relay log file on the slave server.
CThe name of the error log file for the master server.
DThe name of the configuration file used by the master.
Attempts:
2 left
💡 Hint
Think about what the master writes to keep track of changes for replication.
🧠 Conceptual
intermediate
1:30remaining
Role of Relay Logs in Replication
In MySQL replication, what is the primary purpose of the relay log on the slave server?
ATo log errors encountered during replication.
BTo store the changes read from the master's binary log before applying them locally.
CTo keep a backup of the master's binary logs.
DTo store the binary logs generated by the slave server.
Attempts:
2 left
💡 Hint
Relay logs act as a temporary storage on the slave.
📝 Syntax
advanced
1:00remaining
Correct Syntax to Start Slave Replication
Which of the following commands correctly starts the replication process on a MySQL slave server?
ASTART SLAVE;
BBEGIN SLAVE;
CRUN SLAVE;
DINITIATE SLAVE;
Attempts:
2 left
💡 Hint
The command uses the word 'START'.
🔧 Debug
advanced
2:00remaining
Troubleshooting Replication Error
A MySQL slave shows the error Last_SQL_Error: Error 'Duplicate entry' for key 'PRIMARY'. What is the most likely cause?
AThe relay log on the slave is missing.
BThe master server's binary log is corrupted.
CThe slave tried to apply a change that conflicts with existing data, causing a duplicate primary key.
DThe slave server has lost network connection to the master.
Attempts:
2 left
💡 Hint
Think about what a duplicate primary key error means in data replication.
optimization
expert
2:30remaining
Improving Replication Performance
Which of the following changes is most effective to reduce replication lag on a MySQL slave?
AIncrease the size of the master's binary log files.
BSet the slave's <code>read_only</code> variable to OFF.
CDisable the relay log on the slave server.
DEnable multi-threaded replication by setting <code>slave_parallel_workers</code> to a value greater than 0.
Attempts:
2 left
💡 Hint
Think about how the slave can apply changes faster.