MySql server startup error ‘The server quit without updating PID file ‘

Love The Way You Lie 2022-12-25 12:55 337阅读 0赞

导致这个问题发生的原因貌似有很多,所以关键是定位到真正的问题。

mysql启动报错会生成一个.err文件。我的centos的该文件存在于/var/lib/mysql/*.err。打开这个文件就会看到启动错误的原因。

我这里是:

  1. 2020-12-01 22:45:51 18295 [Note] InnoDB: Using atomics to ref count buffer pool pages
  2. 2020-12-01 22:45:51 18295 [Note] InnoDB: The InnoDB memory heap is disabled
  3. 2020-12-01 22:45:51 18295 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  4. 2020-12-01 22:45:51 18295 [Note] InnoDB: Memory barrier is not used
  5. 2020-12-01 22:45:51 18295 [Note] InnoDB: Compressed tables use zlib 1.2.3
  6. 2020-12-01 22:45:51 18295 [Note] InnoDB: Using Linux native AIO
  7. 2020-12-01 22:45:51 18295 [Note] InnoDB: Using CPU crc32 instructions
  8. 2020-12-01 22:45:51 18295 [Note] InnoDB: Initializing buffer pool, size = 128.0M
  9. InnoDB: mmap(137363456 bytes) failed; errno 12
  10. 2020-12-01 22:45:51 18295 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
  11. 2020-12-01 22:45:51 18295 [ERROR] Plugin 'InnoDB' init function returned error.
  12. 2020-12-01 22:45:51 18295 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  13. 2020-12-01 22:45:51 18295 [ERROR] Unknown/unsupported storage engine: InnoDB
  14. 2020-12-01 22:45:51 18295 [ERROR] Aborting

针对于这个错误,再去百度、google。就发现错误因为竟然是wordpress启动了php-fpm,进而导致的mysql启动失败。我停了php-fpm之后再启动mysql。就看到了久违的success。

后来再一次遇到这个错误,发现不能停到wordpress也不能解决问题。后来查看内存占用free命令如下:

  1. [root@node1 ~]# free
  2. total used free shared buffers cached
  3. Mem: 1019772 575584 444188 164 5840 148308
  4. -/+ buffers/cache: 421436 598336
  5. Swap: 0 0 0

发现根本没有swap空间。综合上一次的问题。很可能是因为内存不足导致。所以添加swap空间之后就启动成功了。

我是centos 6.10。诸位可根据自己的系统进行配置。

  1. $ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 #增加1G的SWAP进去
  2. $ sudo mkswap /swapfile
  3. $ sudo swapon /swapfile
  4. [root@node1 ~]# free
  5. total used free shared buffers cached
  6. Mem: 1019772 951116 68656 172 3224 489856
  7. -/+ buffers/cache: 458036 561736
  8. Swap: 1048572 0 1048572
  9. [root@node1 ~]# service mysql start
  10. Starting MySQL.. [ OK ]
  11. [root@node1 ~]#

发表评论

表情:
评论列表 (有 0 条评论,337人围观)

还没有评论,来说两句吧...

相关阅读