AWS RDS for MySQL Basic maintenance

Source: Internet
Author: User

1. AWS Query Slow Log


Select COUNT (1), user_host from Mysql.slow_log Group by User_host;

Select COUNT (*) from Mysql.slow_log;

mysql> desc Mysql.slow_log;

+----------------+---------------------+------+-----+-------------------+-----------------------------+

| Field | Type | Null | Key | Default | Extra |

+----------------+---------------------+------+-----+-------------------+-----------------------------+

| start_time | Timestamp |     NO | | Current_timestamp | On Update Current_timestamp |

| User_host | Mediumtext |     NO | |                             NULL | |

| Query_time | Time |     NO | |                             NULL | |

| Lock_time | Time |     NO | |                             NULL | |

| rows_sent | Int (11) |     NO | |                             NULL | |

| rows_examined | Int (11) |     NO | |                             NULL | |

| db | VARCHAR (512) |     NO | |                             NULL | |

| last_insert_id | Int (11) |     NO | |                             NULL | |

| insert_id | Int (11) |     NO | |                             NULL | |

| server_id | Int (Ten) unsigned |     NO | |                             NULL | |

| Sql_text | Mediumtext |     NO | |                             NULL | |

| thread_id | bigint (+) unsigned |     NO | |                             NULL | |

+----------------+---------------------+------+-----+-------------------+-----------------------------+



Mysql> Select Query_time,sql_text from Mysql.slow_log ORDER BY query_time desc limit 30; --Slow query installation time sequencing

Mysql> Select Query_time,sql_text from Mysql.slow_log where Query_time > ' 00:00:10 '; --Query for slow queries larger than 10s


AWS RDS for MySQL Basic maintenance

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.