mysql 无法启动 ,查看日志:

--01T15::.401599Z  [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
--01T15::.403209Z [Note] /usr/sbin/mysqld (mysqld 5.7.) starting as process ...
--01T15::.406004Z [Note] InnoDB: PUNCH HOLE support available
--01T15::.406028Z [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
--01T15::.406032Z [Note] InnoDB: Uses event mutexes
--01T15::.406035Z [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
--01T15::.406038Z [Note] InnoDB: Compressed tables use zlib 1.2.
--01T15::.406041Z [Note] InnoDB: Using Linux native AIO
--01T15::.406290Z [Note] InnoDB: Number of pools:
--01T15::.406379Z [Note] InnoDB: Using CPU crc32 instructions
--01T15::.407775Z [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = , chunk size = 128M
--01T15::.407813Z [ERROR] InnoDB: mmap( bytes) failed; errno
--01T15::.407819Z [ERROR] InnoDB: Cannot allocate memory for the buffer pool
--01T15::.407824Z [ERROR] InnoDB: Plugin initialization aborted with error Generic error
--01T15::.407829Z [ERROR] Plugin 'InnoDB' init function returned error.
--01T15::.407832Z [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
--01T15::.407834Z [ERROR] Failed to initialize plugins.
--01T15::.407836Z [ERROR] Aborting --01T15::.407852Z [Note] Binlog end
--01T15::.407890Z [Note] Shutting down plugin 'CSV'
--01T15::.408059Z [Note] /usr/sbin/mysqld: Shutdown complete

定位到最后几行,果然有一个FATAL ERROR:Cannot allocate memory for the buffer pool,看来应该是mariadb没有配置好,php程序访问量稍微大一些,分配给mariadb的内存就满了,然后就锁死了,mysql –u root –p竟然也打不开,看来确实是mariadb daemon挂掉了…

Innodb 存储引擎的缓存机制和 MyISAM 的最大区别就在于 Innodb 不仅仅缓存索引,同时还会缓存实际的数据。所以,完全相同的数据库,使用 Innodb 存储引擎可以使用更多的内存来缓存数据库相关的信息,当然前提是要有足够的物理内存。innodb_buffer_pool_size 参数用来设置 Innodb 最主要的 Buffer(Innodb_Buffer_Pool)的大小,也 就是缓存用户表及索引数据的最主要缓存空间,对 Innodb 整体性能影响也最大。这个参数设置成内存的50%-80%,当然具体要结合实际情况而定,考虑别的存储引擎占用的内存,考虑服务器是不是还提供其他服务等等…看来,我的机器之所以宕掉的原因是,系统默认的内存:

default innodb_buffer_pool_size

innodb_buffer_pool_size=50M

再次启动

sudo systemctl start mysqld

恢复正常

关闭suse:

查看SELinux状态:

1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

SELinux status:                 enabled

2、getenforce                 ##也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0                  ##设置SELinux 成为permissive模式

##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

参考:https://blog.feehi.com/linux/132.html

mysql安装:

https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7

centos Cannot allocate memory for the buffer pool的更多相关文章

  1. MySql启动,提示:Plugin 'FEDERATED' is disabled....Cannot allocate memory for the buffer pool

    2016-05-27 09:25:01 31332 [Note] Plugin 'FEDERATED' is disabled. 2016-05-27 09:25:01 31332 [Note] In ...

  2. [ERROR] InnoDB: Cannot allocate memory for the buffer pool

    :: mysqld_safe Starting mysqld daemon with databases from /data/mysqldb -- :: [Note] /usr/local/mysq ...

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

    mysql以`systemctl start mysqld.service`的方式启动一段时间后发现突然无法启动,尝试重新启动也不能解决问题,排查问题时,先后通过`systemctl status m ...

  4. mysql启动报错cannot allocate memory for the buffer pool处理

    今天启动mysql服务器时失败了.去/var/log/mysql/查看error.log,报错信息如下: 160123 22:29:26 InnoDB: Initializing buffer poo ...

  5. Fatal error: cannot allocate memory for the buffer pool

    mysql有时候会被系统kill掉,原因是内存不够了,一般都是Ubuntu出现的,因为Ubuntu吃内存,你们又给的不多.. 咋解决呢? 重启服务器是可以的,起码暂时可以了, 可以考虑加内存,或者增加 ...

  6. Cannot allocate memory for the buffer pool

    优化了一通,启动不了 直接上日志 innodb_buffer_pool_size”.”key_buffer_size” 的大小设置,适当的调大内存分配,减小,然后保存配置文件,重新尝试启mysql 成 ...

  7. MySQL:cannot allocate the memory for the buffer pool

    InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins Inno ...

  8. [转]MySQL innodb buffer pool

    最近在对公司的 MySQL 服务器做性能优化, 一直对 innodb 的内存使用方式不是很清楚, 乘这机会做点总结. 在配置 MySQL 的时候, 一般都会需要设置 innodb_buffer_poo ...

  9. InnoDB Status Output – Buffer Pool and Spin Rounds

    InnoDB has a good source of information about its status which can be requested every time you need ...

随机推荐

  1. python全栈开发笔记---基本数据类型--字符串魔法

    字符串: def capitalize(self, *args, **kwargs) test = "aLxs" v = test.capitalize() #capitalize ...

  2. MATLAB 批量处理图片

    function resizephotos(directory, wh, isrecursive, isoverwrite, savetopath, supportFormat) % resizeph ...

  3. 双引号与尖括号的区别 and 相对路径与绝对路径

    包含头文件的时候,如果包含的是自己写的头文件是用" " .如果是包含系统的头文件,一般用<>. 相对路径与绝对路径

  4. C/C++知识补充 (1)

    ● C++的圆括号运算符() 下列关于圆括号运算符的功能说法不正确的是(C) . A. 可用于强制类型转换 B 可用于类型构造 C 可用于类型声明 D 可用于函数调用 对大部分可重载的运算符来说,它既 ...

  5. Cracking The Coding Interview 9.3

    //Given a sorted array of n integers that has been rotated an unknown number of times, give an O(log ...

  6. 深入margin

    1.外边距叠加 外边距叠加是指两个垂直外边距相遇时,这两个外边距会合并成一个外边距,就是二变一,关键是叠加后的外边距会取值两个外边距最大的那个: 例子如下:创建A.B两个盒子,A定义一个margin- ...

  7. SQL-35 对于表actor批量插入如下数据,如果数据已经存在,请忽略,不使用replace操作

    题目描述 对于表actor批量插入如下数据,如果数据已经存在,请忽略,不使用replace操作CREATE TABLE IF NOT EXISTS actor (actor_id smallint(5 ...

  8. DevExpress WinForms使用教程:Diagram Control

    [DevExpress WinForms v18.2下载] DevExpress WinForms v18.2包含WinForms和WPF Diagram Controls的三个高要求功能:新的Dia ...

  9. NuGet 程序源包

    https://api.nuget.org/v3/index.json  (2018-4-24 10:20:07-最新测试,可以用) https://nuget.cnblogs.com/v3/inde ...

  10. pytest的fixture和conftest

    解决问题:用例1需要先登录,用例2不需要登录,用例3需要先登录.很显然这就无法用setup和teardown来实现了,这个时候就可以自定义测试用例的预置条件,比setup灵活很多. 1.fixture ...