The location problem of MySQL optimization

Source: Internet
Author: User

First introduce a few key words

1 Show status indicates the current state data for the database

Show [Session|global] status session is the statistical result of the current connection global is all the statistical results since the database service was started

Show status like ' com_% '; Where com_xxx represents the number of times that the XXX statement was executed we mainly focus on the com_select,com_insert,com_update,com_delete of the several parameters, respectively, the number of queries, number of additions, number of updates, number of deletions

Besides, there are a few other parameters worth noting

Connections: Number of attempts to connect to MySQL server

Uptime: The time the server is working (in seconds)

Slow_queries: Number of slow queries

And then go to the key place. Slow Query

When the slow query is the query time is more than the slow query set time is slow query, such as slow query time set is 10 seconds have a query more than 10 seconds This query is called slow query slow query time can be set by itself

First look at how long slow queries are open for slow queries

Log_slow_queries to determine if the time to open long_query_time slow query is

Turn on Slow query

long_query_time=2
Slow-query-log=on
slow_query_log_file= "C:/Program files/mysql/mysql Server 5.6/mysql_slow_query.log"

These three parameters are placed under [MYSQLLD] and then restart the database service in the query can see the slow query opened

The location problem of MySQL optimization

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.