How to configure SlowLog in MySQL)

Source: Internet
Author: User
Tags ssis

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.