MySql啟動報錯,無法更新PID文件
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://bluehumor.blog.51cto.com/2148378/1955247
MySql啟動報錯,無法更新PID文件