共计 949 个字符,预计需要花费 3 分钟才能阅读完成。
MySQL 启动报错
Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql..)
1,查看错误日志
2017-08-10 19:38:14 31865 [Note] InnoDB: Initializing buffer pool, size = 50.0M
InnoDB: mmap(53657600 bytes) failed; errno 12
2017-08-10 19:38:14 31865 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-08-10 19:38:14 31865 [ERROR] Plugin ‘InnoDB’ init function returned error.
2017-08-10 19:38:14 31865 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2017-08-10 19:38:14 31865 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-08-10 19:38:14 31865 [ERROR] Aborting
2,查看空间使用量
free -ml
total used free shared buffers cached
Mem: 608476 565044 43432 0 1284 53996
-/+ buffers/cache: 509764 98712
Swap: 0 0 0
发现 Swap 无可用空间 (由于本人用的京东云最低配 1C1G1M)
3,增加 Swap 空间
dd if=/dev/zero of=/home/swap bs=1024 count=512000
/sbin/mkswap /home/swap
再接着使用这个 swap 分区。使其成为有效状态。
/sbin/swapon /home/swap
4, 重启 Mysql
service mysql restart
ps:my.cnf
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-08/146191.htm