In the My.cnf file, add:
DataDir =/usr/local/mysql/datalong_query_time = # record the query time checked for 1 seconds. log-slow-queries =/usr/local/mysql/log/db-test2-slow.log# Log directory. #log-queries-not-using-indexes# represents a query that does not use an index in the record.
After that, restart MySQL, prompting:
[[Email protected] subsys]# service MySQL Statusmysql is not running [failed][[email Protected] subsys]# service MySQL startstarting mysql.the server quit without updating PID file (/[failed]l/mysql/data/lo CALHOST.LOCALDOMAIN.PID).
Steps to resolve:
1, the above a few lines of new added all the comments out,
2. Delete the/var/lock/subsys/mysql
3. Change the utf-8 inside the config file to UTF8
Problem solved. However, if you join the slow query at the beginning of this article, you still cannot. To the online check, the original version after 5.6, the way to open the slow query changed.
The open statement should be written like this (modify MY.CNF):
Slow-query-log=1slow-query-log-file=/usr/local/mysql/data/slow.log
Save, restart, problem solved.
Reference information is: http://www.2cto.com/database/201304/203100.html
This article is from the "Linux geek" blog, so be sure to keep this source http://linux200801.blog.51cto.com/10462766/1672062
Turn on MySQL slow query, restart prompt starting mysql.the server quit without updating PID file