1, the MySQL log file system composition2. Slow query log3. Slow Query Log DemoLong_query_time: Set the threshold of the slow query, the SQL that exceeds the sub-set value is logged to the slow query log, the default value is 10sSlow_query_log:
slow query log in MongoDB1. turn on the query log .(1) Dynamic Open , can be selective to the specified DB turn on slow query log , However, the slow query log is manually opened after the server restarts. Db.setprofilinglevel (1,300)The
This article describes the MySQL backup and log, because the backup needs to use the log, so before the backup, if the log content is too long, will be the log and backup separately, the first simple introduction of MySQL log related content.MySQL
One, using the MySQL slow query log location to execute inefficient SQL statements.When MySQL uses the slow query log to locate those SQL statements that perform less efficiently, and start with the--log-slow-queries[=file_name] option, Mysqld
Briefly:The method of analyzing the performance of MySQL statement query in addition to using the EXPLAIN output execution plan, you can also let the MySQL record query over a specified time of the statement, we will exceed the specified time of the
First, performance detection and bottleneck analysis
1 common commands for performance detection
Show status
Display status information, reference: Mysql Show status Command detailed
Show Processlist
View current SQL execution, including
MySQL turn on slow query log MySQL accelerated query speed of a unique weapon: query cache on the MySQL query cache from five angles for detailed analysis: How to query cache, how to configure, how to maintain, how to determine the performance of
Mysql slow query log process mysql slow query log is very useful for tracking problematic queries, you can analyze the resource-consuming SQL statements in code implementation, there is a high reference for our program optimization. This article
Instance shutdown commandREDID-CLI shutdown Description: Forced bgsave on close so it takes some time note: At start, you need to load the data into memory before Redis listen the port after the data is loadedCluster-related commands1. CLUSTER Info
Log file type
MySQL has several different log files that can help you find out what's going on inside Mysqld:
Log files
Type of information entered in a file
Error log
Log a problem that occurs when you start, run,
User management of the MySQL database user and log management database1.mysql user account management user account [email protected] Username: Account name host: Which client host requests this account can create connection threads, which can be IP,
MySQL slow log?MySQL's slow query log is a log record provided by MySQL, which is used to record a statement in MySQL that has a response time exceeding the threshold, which refers to SQL that runs longer than the Long_query_time value, and is
First, the log introduction MySQL logs are mainly divided into four categories, using these log files, you can see what happened inside MySQL. These four types of logs are:
Error log
Logs a problem that occurs when the MySQL service
Open binary log (binary log content: Change the operation of the database)In the/ETC/MYSQL/MY.CNFRemove the comment from the Log_bin line to open the following is the saved pathThe following expire_logs_days is how long, MySQL automatically deletes
1 Slow query definition
MySQL records all SQL statements that execute a time threshold that exceeds the Long_query_time parameter setting. The slow query log is the log that logs these SQL.
2 Open Slow query log
Locate the MySQL configuration
Use MySQL 5.7.9 as the monitoring database for Zabbix 2.4.7. Some time ago opened a slow query log, and later found that the slow query log expanded to 700M
See the last 100 most of them are 0.1 seconds later want to change, previously is the
Today, database operations are increasingly becoming a performance bottleneck for the entire application, especially for Web applications. As for the performance of the database, this is not just something that DBAs need to worry about, and that's
The recent project on the DB relies on more heavy, combing this period of time using MySQL encountered 8 more representative problems, the answer is also more biased development practice, no DBA professional and in-depth, please make hard to shoot
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.