mysql报错mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool

mysql以`systemctl start mysqld.service`的方式启动一段时间后发现突然无法启动,尝试重新启动也不能解决问题,排查问题时,先后通过`systemctl status mysqld.service`和`journalctl -xe` 命令查看问题,无所得.然后查看`/var/log/mysqld.log`发现日志内报错信息如下:

2019-02-07T00:33:21.731341Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 1

28M

2019-02-07T00:33:21.731439Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12

2019-02-07T00:33:21.731450Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool

2019-02-07T00:33:21.731464Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error

2019-02-07T00:33:21.731477Z 0 [ERROR] Plugin ‘InnoDB‘ init function returned error.

2019-02-07T00:33:21.731483Z 0 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.

2019-02-07T00:33:21.731489Z 0 [ERROR] Failed to initialize builtin plugins.

2019-02-07T00:33:21.731493Z 0 [ERROR] Aborting

网上查阅资料,有人说是 swap不够了,使用`free`命令查看发现空余swap确实为0,但很奇怪,我买的vultr和ecs使用`free`看到的空余的swap都是0,那么为什么vultr部署的mysql服务挂掉了,ecs的没有挂掉呢? 后来使用命令`sudo dd if=/dev/zero of=/swapfile bs=1M count=1024` 增加swap发现不起作用,我的空余swap仍然是0。

又查阅资料,有人说修改`my.cnf`里,将`innodb_buffer_pool_size` 注释打开,然后重启服务,发现还是报错.

后来将我的`my.cnf` 里的`innodb_buffer_pool_size= 64M`调低到64M,然后重启服务,mysql启动成功。

总结: 可能是我的服务器配置较低,使得mysql5.7正常的 `Initializing buffer pool=128`无法分配成功,降低其配置即可以。
`

原文地址:https://www.cnblogs.com/zhaowinter/p/10354620.html

时间: 2024-10-27 18:44:49

mysql报错mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool的相关文章

MySQL测试环境遇到 mmap(xxx bytes) failed; errno 12解决方法

查看Mysql日志 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 InnoDB: Completed initialization of buffer pool InnoDB: Fatal error: cannot allocate memory for the buffer pool [ERROR] Plugin 'InnoDB' init func

Mysql自动宕机:InnoDB: Cannot allocate memory for the buffer pool

今天早上上班,发现自己使用wordpress搭建的网站不能访问,报如下错误: Error establishing a database connection 赶紧登到自己阿里云服务器(centos7.4)查看mysql服务,通过ps -ef | grep mysql 发现已经没有了mysql进程. 首先要做的是查看mysql日志,通过vi /var/log/mysqld.log果然发现对应的错误异常: 2018-12-26T02:06:16.148626Z 0 [Note] Event Sch

MySQL报错ERROR1872(HY000):Slave failed to initialize

ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository MySQL 5.6修复从库复制时报错 mysql> start slave; ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository 报错原因: 从库已经存在之前的relay log 解决

mysql报错Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage

mysql报错Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage 在执行create table  xx  as  select xx的时候 或者在执行 tpcc-mysql的tpcc_load 的时候 都会遇到这个错误 1534, HY000, Writing one row to the row-based binary log failedRetrying ... 1

在CentOS中安装32位或64位MySql报错error: Failed dependencies解决办法

在CentOS中安装MySql报错error: Failed dependencies解决办法 安装64位MySql报错内容如下:error: Failed dependencies:        libaio.so.1()(64bit) is needed by MySQL-server-5.6.19-1.el6.x86_64    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.19-1.el6.x86_64    

Wamp MySQL 报错 Got a packet bigger than 'max_allowed_packet' bytes

点击电脑右下角wamp图标,然后进入mysql 下面的 my.ini 转移数据发现报这个错,字面意思允许的不够大.网上很多说法不起作用,解决方法如下: [mysqld] port=3306 explicit_defaults_for_timestamp = TRUE max_allowed_packet = 104857600 max_allowed_packet = 104857600 加上这一行. 可以借助Navicat,在数据库中新建查询 输入 show VARIABLES like '%

Mysql报错 :Unknown table engine 'InnoDB'  

问题: zabbix服务器重启后,进入zabbix的web发现登录不进去并且网页报mysql的错误,查看mysql的日之后,发现报错: [[email protected] ~]# tail -f /var/log/mysqld.log 140820 16:24:43 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 33

连接mysql报错:error 2003 (hy000):can't connect to mysql server on 'localhost' (10061)

一.mysql 的bin目录下有个MySQLInstanceConfig.exe,运行就可以进行创建数据库实例,创建实例时也可以生成windows 服务,把服务设置成自动启动就可以了 二.安装在D盘的discuzz!打开后出现上述错误,请问应如何处理?winmysqladmin已经启动,但三色树上有一个小红点如果出现"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)",说明你的MySQL还没有启动.解决办法

Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

安装mysql后,启动时候没有启动成功,查看了下日志报错如下:--------------------------------------------- 1   可以:初始化mysql:mysql_install_db 2   目录权限问题chown -R mysql:mysql  /var/lib/mysql [[email protected] local]# less /var/log/mysqld.log1.查看报错信息如下:[ERROR] Fatal error: Can't open