MySQL slow query log is useful for tracking problematic queries, can be analyzed in the current program has a very resource-intensive SQL statement, that how to open MySQL slow query log records it?
In fact, open
new user Unable to log in workaround
MYSQL like fuzzy query wildcard use detailed introduction
PHP after landing to jump to the pre-landing page implementation ideas and code
PHP Session Exit Login Problem
Four ways to use fuzzy queries in MySQL
thinkphp implementing a like Fuzzy
To see if the log is open
1. Can be confirmed by MySQL profile my.cnf (MySQL defaults to open binary logging):# Replication Master Server (default)# Binary logging is required for replicationLog-bin=mysql-bin
Refresh Log
Flush logs;
View current
-advanced-log | +-------------------------------------------+ 1 row in Set (0.00 sec) create a user and authorize: mysql> Grant all on prod.* to ' Rose ' @ ' percent ' identified by ' Rose '; Query OK, 0 rows affected (0.01 sec) mysql> show grants for Rose; +-----------------------------------------------------------
The main library occupies a large space, found in the OA data directory vigorously Binlog file many, in the server patrol process found that disk space is a large number of occupied, log in from the library to find the actual amount of data, should be occupied by other files, A large number of mysql-bin.xxxxx files are found under the data directory of the main library, and there are about 500 similar files
Mysql Study Notes (log management), mysql Study Notes
Logs: mysql logs that record the running status, daily operations, and error information of the database: Binary logs, error logs, and query logs. Binary log: records database
.00002757158073 -rw-rw---- 1 mysql mysql 24M Mar 6 23:46 mysql-bin.00002857164848 -rw-rw---- 1 mysql mysql 93M Mar 8 18:03 mysql-bin.00002957153914 -rw-rw---- 1 mysql
Analysis of slow query logs by pt-query-digest in MySQL, ptquerydigest
I. Introduction
Pt-query-digest is a tool used to analyze mysql slow queries. It can analyze binlog, General log, and slowlog, you can also use SHOWPROCESSLIST
not the absolute path name, the file is written to the data directory. After the statement is executed and all the locks are released, the slow query log is recorded. The record sequence can be different from the execution sequence.
Slow query logs can be used to locate long-running queries and optimize them. However, it is difficult to check long and slow
default--that is, not included.DB: The log of which library to process.Top: Indicates how many first bars are sorted by rule.Sort: sorted by a rule, T_sum: sorted by total time, C_sum: sorted by total number of times, c_sum_p:sql statement execution count as a percentage of total executions. #开启慢查询日志项配置 Reference files optimized configuration of MySQL performance optimization my.cnf file: http://www.cnblog
Tags: root CTE File Security Ted pre need to suggest emptyBy default, MySQL will keep the mysql-bin file, so that at some point, the disk may be full, whether it is possible to delete these files, whether it can be safely deleted, is a problem. First of all, these files are MySQL log files, if not the master from the c
Label:In MySQL, the slow query log is often used as the basis for us to optimize the database, is there a similar function in MongoDB? The answer is yes, that's the MongoDB database Profiler. So MongoDB not only has, but also has some more detailed information than the MySQL slow Q
Mysql logs are stored in all kinds of logs in any database, recording all aspects of the database's work, to help the database administrator track various events that have occurred in the database. In mysql, there are four different types of logs, namely error logs, binary logs, query logs, and slow query logs. these l
SQL statements with the most queries
Open General LogMysql> Show variables like '%general% ';+------------------+-------------------------------------+| variable_name | Value |+------------------+-------------------------------------+| General_log | Off || General_log_file | /usr/local/mysql/data/localhost.log |+------------------+-------------------------------------+mysql> Set Global General_log = "on";
/etc/redis2.confvim/etc/redis2.conf//need to modify Port,dir,pidfile,logfileand add one more lineslaveof 127.0.0.1 6379If your Lord sets a password, you also need to addMasterauth aminglinux>com//Set Master's passwordDo not forget to create a new dir directory before startingRedis-server/etc/redis2.confTest: Create a new key in the Lord, view from the topNote: Redis master and slave MySQL are never the same, the Redis master does not synchronize the d
ibdata1 ib_logfile1 localhost. pid mysql-bin.indexbrotherblog ib_logfile0 localhost. err mysql test [root @ localhost var] #... /bin/mysql-uroot-p // log on to mysql> use test; // use mysql> flush logs; // refresh the binlog and
Tags: Chinese show query Statements bindml Type file name nbspdiv Binlog basic understanding of MySQL binary log is the most important log of MySQL, it records all the DDL and DML (except the data query statement) statements, l
sec)
Mysql> set slow_query_log = 'on'; // Add global. Otherwise, an error is returned.
ERROR 1229 (HY000): Variable 'slow _ query_log 'is a GLOBAL variable and shocould be set with SET GLOBAL
Mysql> set global slow_query_log = 'on'; // enable slow Query
Query OK, 0 rows affected (0.28 sec)
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.