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

付费节点推荐


免费节点


节点使用教程


 # service mysql status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

 # service mysql restart
ERROR! 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,正常!!!!

未经允许不得转载:Bcoder资源网 » the server quit without updating pid file (/usr/local/mysql/data/mysql.pid)

相关推荐

更多优质资源关注微信公众号: bcoder

bcoder
赞 (2)
分享到:更多 ()

评论 0

评论前必须登录!

登陆 注册