Challenge - 5 Problems
MySQL Monitoring Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Identify slow queries using MySQL slow query log
You enabled the slow query log in MySQL with the following settings:
What will be the output of the command below?
slow_query_log = ON
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 2What will be the output of the command below?
tail -n 5 /var/log/mysql/mysql-slow.logAttempts:
2 left
💡 Hint
The slow query log records queries that exceed the long_query_time threshold.
✗ Incorrect
The slow query log file contains queries that took longer than the configured long_query_time (2 seconds here). The tail command shows the last 5 entries from this log.
❓ Configuration
intermediate1:30remaining
Configure MySQL to enable performance schema for profiling
Which configuration snippet correctly enables the Performance Schema in MySQL for detailed query profiling?
Attempts:
2 left
💡 Hint
Check the exact variable name and accepted values in MySQL documentation.
✗ Incorrect
The correct variable to enable Performance Schema is 'performance_schema' and it accepts 'ON' or 'OFF' as values.
❓ Troubleshoot
advanced2:00remaining
Diagnose why slow query log is not recording queries
You enabled the slow query log with:
But no queries appear in the slow query log file. What is the most likely cause?
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;But no queries appear in the slow query log file. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check file permissions and ownership for the log file path.
✗ Incorrect
If MySQL cannot write to the slow query log file due to permission issues, no queries will be logged even if logging is enabled.
🔀 Workflow
advanced2:30remaining
Steps to profile a query using Performance Schema
Arrange the steps in the correct order to profile a slow query using MySQL Performance Schema.
Attempts:
2 left
💡 Hint
Profiling requires enabling, running, then analyzing.
✗ Incorrect
First enable Performance Schema and restart MySQL. Then run the query to collect data. Next, query the Performance Schema tables. Finally, analyze the data.
✅ Best Practice
expert3:00remaining
Best practice for continuous MySQL query performance monitoring
Which approach is best for continuous monitoring of MySQL query performance in a production environment?
Attempts:
2 left
💡 Hint
Consider automation and minimal manual effort for continuous monitoring.
✗ Incorrect
Performance Schema combined with automated monitoring tools provides continuous, detailed insights with minimal manual work, ideal for production.