Enable Slow Query Log for MySQL
Modify MySQL Configuration
To enable slow query log, you need to change the following MySQL configuration in MySQL configuration file (e.g. /etc/mysql/my.cnf
):
slow_query_log
: Enable slow query log.long_query_time
: The minimum execution time (in seconds) to be logged.log_output
: The destination for log output.TABLE
means log tomysql.slow_log
table. Bytebase will read from this table to sync and display the slow queries.
Restart MySQL
After you change the MySQL configuration, you need to restart MySQL to make the change effective.
Check MySQL Variables
You can check the MySQL variables to make sure the change is effective.