PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 数据库 > MySQL教程 > 正文

    mysql InnoDB: Cannot allocate memory for the buffer pool

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:Cannot allocate memory for the buffer pool都说是无法给innodb分配足够的内存,大多数给出的解决的方案是:修改innodb_buffer_pool_size,但是我这个my.cnf里面没有


    1. 2017-09-03 17:38:21 20390 [Note] InnoDB: The InnoDB memory heap is disabled 
    2. 2017-09-03 17:38:21 20390 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
    3. 2017-09-03 17:38:21 20390 [Note] InnoDB: Memory barrier is not used 
    4. 2017-09-03 17:38:21 20390 [Note] InnoDB: Compressed tables use zlib 1.2.3 
    5. 2017-09-03 17:38:21 20390 [Note] InnoDB: Using Linux native AIO 
    6. 2017-09-03 17:38:21 20390 [Note] InnoDB: Using CPU crc32 instructions 
    7. 2017-09-03 17:38:21 20390 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
    8. InnoDB: mmap(137363456 bytes) failed; errno 12 
    9. 2017-09-03 17:38:21 20390 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 
    10. 2017-09-03 17:38:21 20390 [ERROR] Plugin ‘InnoDB’ init function returned error. 
    11. 2017-09-03 17:38:21 20390 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 
    12. 2017-09-03 17:38:21 20390 [ERROR] Unknown/unsupported storage engine: InnoDB 
    13. 2017-09-03 17:38:21 20390 [ERROR] Aborting 
    14. 2017-09-03 17:38:21 20390 [Note] Binlog end 
    15. 2017-09-03 17:38:21 20390 [Note] Shutting down plugin ‘partition’ 
    16. 2017-09-03 17:38:21 20390 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’ 

    其中标为黄色的就比较重要了,百度Cannot allocate memory for the buffer pool都说是无法给innodb分配足够的内存,大多数给出的解决的方案是:修改innodb_buffer_pool_size,但是我这个my.cnf里面没有,那就加一个被呗,顺便将这个字段设置成200M,重启mysql发现一样的结果,还是启动不了,去看日志还是一样的问题,还是太大咯?

    用free -m看下

    total        used        free      shared  buff/cache   available
    Mem:            992         574         159           0         258         260
    Swap:             0           0           0

    只有185M的内存了,只能再改小点咯,改成64.

    service mysqld restart,终于

    Starting MySQL. [ OK ]

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-35-5959-1.html
    相关热词搜索: