1.背景
阿里云的服务无故挂了,查看磁盘满了,导致mysql报错。
重启mysql报如下错误
日志目录 /var/log/mysqld.log
2018-03-22 22:54:02 13638 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2018-03-22 22:54:02 13638 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2018-03-22 22:54:02 13638 [ERROR] Plugin 'InnoDB' init function returned error.
2018-03-22 22:54:02 13638 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-03-22 22:54:02 13638 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-03-22 22:54:02 13638 [ERROR] Aborting
2.解决方案
找到 /etc/mysql/my.cnf
设置内存:
innodb_buffer_pool_size=50M