Original: http://blog.csdn.net/a11085013/article/details/17370053Show variables like '%quer% '; query whether to open a slow query!!Step One: Modify My.ini (mysql config file)Add the following two words to the My.iniLog-slow-queries = "D:\wamp\mysql_
1. What is the slow query for MySQL?
The most influential speed in MySQL is those Enquiry very slow statements, these slow statements, may be less than reasonable to write or large data under the union of multiple tables Enquiry and
There are many articles on the web to teach how to configure MySQL server, but considering the different server hardware configuration, the specific application of the difference, those articles can only be used as a preliminary set of reference, we
The slow query log of the MySQL database is an important tuning auxiliary log, but the log format of the MySQL default record is not friendly enough to read, which is determined by the MySQL logging rule, capturing one record, although the recorded
1, configuration onLinux:Added in MySQL config file my.cnfLog-slow-queries=/var/lib/mysql/slowquery.log (Specify the log file location, can be empty, the system will give a default file Host_name-slow.log)long_query_time=2 (record over time, default
1. The configuration is enabled.Linux: In the mysql configuration file my. add log-slow-queries =/var/lib/mysql/slowquery in cnf. log (specify the location where the log file is stored, which can be null, the system will give a default file
One, slow query log configuration
Turn on the slow query log to configure the sample:
/etc/mysql/my.cnf[Mysqld]Log-slow-queries
Add the above configuration entry in the MY.CNF configuration file and restart the MySQL service, when the MySQL slow
In MySQL, the definition time of the slow query is specified by the mysql built-in parameter variable long_query_time, its default value is 10 (in seconds), we can show variables like ' long_query_time '; Directive to view the information for this
first, MySQL's slow query log opening and storage1, check whether the SQL records that do not use the index to the slow query log, view the log_queries_not_using_indexes variable; like "Log_queries_%"Results:If the value of the query is off, it
First, Introduction to open the slow query log, you can let the MySQL record query over a specified time of the statement, through the location analysis performance bottlenecks, to better optimize the performance of the database systemSecond,
MySQL Slow queryIn web development, we often write some SQL statements, a bad SQL statement may make your entire program very slow, more than 10 seconds the average user will choose to close the Web page, how to optimize the SQL statement to run
First, IntroductionTurn on the slow query log, you can let the MySQL record query over a specified time of the statement, through the location analysis of performance bottlenecks, to better optimize the performance of the database system.Second,
First, IntroductionTurn on the slow query log, you can let the MySQL record query over a specified time of the statement, through the location analysis of performance bottlenecks, to better optimize the performance of the database system.Second,
1. What is the use of slow queries? It records all SQL statements that execute more than long_query_time time, helping you find SQL that executes slowly, so we can optimize these SQL. 2. How do I turn on slow queries? First, we check that the MySQL
Let's take a look at how to read these slow query logs.Before you trace a slow query log, you must first ensure that you have a slow query at least once. If you are not able to make one yourself:[Email protected]# mysql-e ' SELECT SLEEP (8);There's
open MySQL slow query under Linux1. Introduction to Slow QueriesAs the name implies, the slow query log is a long-running query SQL statement, the default file name is Hostname-slow.log, the default directory is also the data directory. The slow
In web development, we often write some SQL statements. A bad SQL statement may make your entire program very slow. After 10 seconds, users usually choose to close the webpage, how to optimize SQL statements to find out SQL statements that have been
1. The configuration is enabled.Linux:AddLog-slow-queries =/var/lib/mysql/slowquery. log (specify the location where the log file is stored, which can be empty and the system will give a default file host_name-slow.log)Long_query_time = 2 (the time
How to record MySQL slow query SQL logs
Modify the mysqld section of my. CNF:Long_query_time = 1 // defines the slow query time. 1 indicates 1 second.-- Log-Slow-queries [= file_name] // record slow query to log files-- Log-queries-not-using-indexes
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.