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

猜你喜欢

转载自www.linuxidc.com/Linux/2017-08/146191.htm