mysql之启动失败(InnoDB: mmap(137363456 bytes) failed; errno 12)

软件版本

linux版本:cat /etc/redhat-release

CentOS release 6.9 (Final)

mysql版本:SELECT VERSION();

mysql 5.6.44

 

问题描述

linux系统下启动mysql数据库失败:

[root@iZ8vb32fixtn mysql]# /etc/init.d/mysqld start 
Starting MySQL. ERROR! The server quit without updating PID file (/data/mysql_data//mysql.pid).

查看数据库日志文件:

[root@iZ8vb32fixtn mysql_data]# tail -f ./error.err
2019-12-04 17:30:09 9538 [Note] Plugin 'FEDERATED' is disabled.
2019-12-04 17:30:09 9538 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-12-04 17:30:09 9538 [Note] InnoDB: The InnoDB memory heap is disabled
2019-12-04 17:30:09 9538 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-12-04 17:30:09 9538 [Note] InnoDB: Memory barrier is not used
2019-12-04 17:30:09 9538 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-12-04 17:30:09 9538 [Note] InnoDB: Using Linux native AIO
2019-12-04 17:30:09 9538 [Note] InnoDB: Using CPU crc32 instructions
2019-12-04 17:30:09 9538 [Note] InnoDB: Initializing buffer pool, size = 1.0G
InnoDB: mmap(137363456 bytes) failed; errno 12
2019-12-04 17:30:09 9538 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2019-12-04 17:30:09 9538 [ERROR] Plugin 'InnoDB' init function returned error.
2019-12-04 17:30:09 9538 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-12-04 17:30:09 9538 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-12-04 17:30:09 9538 [ERROR] Aborting

 中文翻译:

2019-12-04 17:30:09 9538 [注意]插件'FEDERATED'已禁用。
2019-12-04 17:30:09 9538 [Note] InnoDB:使用原子来引用计数缓冲池页面
2019-12-04 17:30:09 9538 [Note] InnoDB:InnoDB内存堆已禁用
2019-12-04 17:30:09 9538 [Note] InnoDB:互斥体和rw_locks使用GCC原子内置函数
2019-12-04 17:30:09 9538 [Note] InnoDB:不使用内存屏障
2019-12-04 17:30:09 9538 [Note] InnoDB:压缩表使用zlib 1.2.11
2019-12-04 17:30:09 9538 [Note] InnoDB:使用Linux本机AIO
2019-12-04 17:30:09 9538 [Note] InnoDB:使用CPU crc32指令
2019-12-04 17:30:09 9538 [Note] InnoDB:正在初始化缓冲池,大小= 1.0G
InnoDB:mmap(137363456字节)失败;埃尔诺12
2019-12-04 17:30:09 9538 [错误] InnoDB:无法为缓冲池分配内存
2019-12-04 17:30:09 9538 [错误]插件'InnoDB'初始化函数返回错误。
2019-12-04 17:30:09 9538 [错误]插件'InnoDB'注册为存储引擎失败。
2019-12-04 17:30:09 9538 [ERROR]未知/不受支持的存储引擎:InnoDB
2019-12-04 17:30:09 9538 [ERROR]正在中止

原因

内存不够用,内存不足造成的。

 

 解决方法

因为由于是内存不够用的问题,也可以说你的服务器配置过低,需要考虑服务器配置升级的问题。

1、查看服务器的剩余内存

可以用"free -m"命令来查看自己服务器的内存:

$ free -m

 

2.修改mysql配置文件my.cnf,添加如下设置参数:把mysql给InnoDB分配的内存设置为8M

innodb_buffer_pool_size = 8M

3.启动mysql:

/etc/init.d/mysqld start

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值