[ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12

今天发现mysql突然挂掉了,查看mysqld.log日志,大概是无法分配到内存的原因,报错如下:

2019-05-31T01:57:36.046897Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 15291
2019-05-31T01:57:36.244224Z 0 [ERROR] [MY-012681] [InnoDB] mmap(137363456 bytes) failed; errno 12

2019-05-31T01:57:36.244331Z 1 [ERROR] [MY-012956] [InnoDB] Cannot allocate memory for the buffer pool
2019-05-31T01:57:36.244433Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2019-05-31T01:57:36.245355Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2019-05-31T01:57:36.246294Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-05-31T01:57:36.248939Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-05-31T01:57:36.256793Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server – GPL.

解决方法:

查看mysql配置文件my.cnf中的 innodb_buffer_pool_size 参数是否设置过大,导致mysql的缓冲池占用过多,服务器内存不足导致无法分配到内存,因此挂掉。

我的是因为新装的mysql8,innodb_buffer_pool_size 这个参数默认是被注释的,设置成8m,成功启动!


71 Clicks !

发表评论

电子邮件地址不会被公开。