当前位置:K88软件开发文章中心编程语言LinuxLinux01 → 文章内容

the server quit without updating pid file (/usr/local/mysql/data/mysql.pid)

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-4 9:03:13

-->
 # service mysql statusERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists # service mysql restartERROR! MySQL server PID file could not be found!Starting MySQL.... ERROR! the server quit without updating pid file (/usr/local/mysql/data/mysql.pid)

问题原因,服务器在高并发下宕机,导致服务器启动报错~~ 。报错如上所示。

百度,google所有的答案无效,同样的问题,大半年开始出现到现在无解。

查看日志:

cd?/usr/local/mysql/var

vim?li1699-77.members.linode.com.err
171101 15:05:42 [Note] Plugin ‘FEDERATED’ is disabled.
171101 15:05:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
171101 15:05:42 InnoDB: Compressed tables use zlib 1.2.3
171101 15:05:42 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
171101 15:05:42 InnoDB: Completed initialization of buffer pool
171101 15:05:42 InnoDB: Fatal error: cannot allocate memory for the buffer pool
171101 15:05:42 [ERROR] Plugin ‘InnoDB’ init function returned error.
171101 15:05:42 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
171101 15:05:42 [ERROR] Unknown/unsupported storage engine: InnoDB
171101 15:05:42 [ERROR] Aborting

如上提示内存不足~~~所以我们在 /etc/my.cnf 中改了如下选项:

innodb_buffer_pool_size=50M

再重新运行/etc/init.d/mysql start,启用依旧失败 the server quit without updating pid file

想了想,pid是进程文件吗? 索性 find / -name mysql.pid ?竟然提示没有。

然后特地检查下配置文件,发现datadir,log-error,pid-file 都被我配置错了,抄的时候没注意。。。正确的路径。

datadir = /usr/local/mysql/var/
log-error = /usr/local/mysql/data/error.log
pid-file = /usr/local/mysql/data/mysql.pid
user = mysql
tmpdir = /tmp

改完重启mysql,正常!!!!


the server quit without updating pid file (/usr/local/mysql/data/mysql.pid)