The mysql Log System has been online for some time, and the front-end is slowly cutting the site to write data. We plan to diy a mysql monitoring tool.
It can be divided into slave status, sync, objec infot, userprivileges, job status, and slowlog.
Slow_log
Mysql 1.5 supports global set to change variable settings. You do not need to restart the service.
Available
Show variables to view variable settings
Enable log_output table Option 5.1 and later versions support the use of table and file options at the same time, such as: set global log_output = 'table, file ';
Enable log_slow_query
Set global log_slow_query = on;
Use show variables like 'long % 'to view long_query_time. The default value is 10 seconds.
In this way, mysql automatically stores the slowlog query statements that exceed 10 seconds in the slow_log table of the mysql database.
Use ssis and proc to monitor multiple servers every day. It is also suitable for large-scale mysql, the next write monitoring points and issues.
Ssis flowchart:
Mail: The slowlog long_query_time is set to 0.