0
0
MySQLquery~20 mins

Binary log management in MySQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Binary Log Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Check Current Binary Log File
What is the output of the following query that shows the current binary log file in MySQL?
MySQL
SHOW MASTER STATUS;
AA table with columns File, Position, Binlog_Do_DB, Binlog_Ignore_DB showing the current binary log file name and position
BAn error saying 'Unknown command SHOW MASTER STATUS;'
CA list of all binary log files on the server
DEmpty result set with no rows
Attempts:
2 left
💡 Hint
SHOW MASTER STATUS shows the current binary log file and position used for replication.
🧠 Conceptual
intermediate
1:30remaining
Purpose of Binary Logs
Which of the following best describes the main purpose of binary logs in MySQL?
ATo log all SELECT queries executed on the server
BTo store all changes to the database for replication and recovery
CTo keep a backup of the entire database every hour
DTo store user login credentials securely
Attempts:
2 left
💡 Hint
Think about what binary logs record and how they are used in replication.
📝 Syntax
advanced
2:30remaining
Enable Binary Logging in MySQL
Which of the following configuration lines correctly enables binary logging in the MySQL server configuration file (my.cnf)?
A
[mysqld]
binlog_format = ROW
log_bin = mysql-bin
B
[client]
log_bin = mysql-bin
C
[mysqld]
log_bin = off
D
[mysqld]
binlog_format = OFF
Attempts:
2 left
💡 Hint
Binary logging must be enabled under the [mysqld] section with log_bin set to a filename prefix.
optimization
advanced
2:30remaining
Reducing Binary Log Size
Which method is the best way to reduce the size of binary logs without losing replication data?
ADelete binary log files manually while the server is running
BDisable binary logging completely
CSet expire_logs_days to a lower number to automatically purge old logs
DSet binlog_format to STATEMENT and run only SELECT queries
Attempts:
2 left
💡 Hint
Think about automatic cleanup of old logs versus manual or disabling logging.
🔧 Debug
expert
3:00remaining
Binary Log Corruption Detection
You suspect a binary log file is corrupted. Which command will help you verify the integrity of binary log files?
Amysqlbinlog --start-position=1 mysql-bin.000001
Bmysqlbinlog --check mysql-bin.000001
Cmysqlbinlog --read-from-remote-server mysql-bin.000001
Dmysqlbinlog --verify mysql-bin.000001
Attempts:
2 left
💡 Hint
Look for a mysqlbinlog option that checks or verifies the log file.