当前位置:Gxlcms > 数据库问题 > 开启mysql慢查询,重启提示Starting MySQL.The server quit without updating PID file

开启mysql慢查询,重启提示Starting MySQL.The server quit without updating PID file

时间:2021-07-01 10:21:17 帮助过:29人阅读

在my.cnf文件中加入:

datadir = /usr/local/mysql/data
long_query_time = 1
#记录下查询时间查过1秒。
log-slow-queries = /usr/local/mysql/log/db-Test2-slow.log
#日志目录。

#log-queries-not-using-indexes
#表示记录下没有使用索引的查询。

之后,重启mysql,提示:

[root@localhost subsys]# service mysql status
MySQL is not running                                       [FAILED]
[root@localhost subsys]# service mysql start
Starting MySQL.The server quit without updating PID file (/[FAILED]l/mysql/data/localhost.localdomain.pid).

解决步骤:

1、将上面几行新加入的全部注释掉,

2、将/var/lock/subsys/mysql删除

3、将配置文件里面的utf-8改为utf8


问题得到解决。但是如果将本文开头的慢查询加入之后仍然不可以。到网上查了一下,原来5.6以后版本,开启慢查询的方法变了。


开启的语句应该这样写(修改my.cnf):

slow-query-log=1
slow-query-log-file=/usr/local/mysql/data/slow.log

保存、重启,问题解决。


参考的资料为:http://www.2cto.com/database/201304/203100.html

本文出自 “linux极客” 博客,请务必保留此出处http://linux200801.blog.51cto.com/10462766/1672062

开启mysql慢查询,重启提示Starting MySQL.The server quit without updating PID file

标签:mysql   server   file   without   local   

人气教程排行