AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 448956
Accepted
Yehia A.Salam
Yehia A.Salam
Asked: 2012-11-16 02:16:21 +0800 CST2012-11-16 02:16:21 +0800 CST 2012-11-16 02:16:21 +0800 CST

MySQL守护进程不断意外终止

  • 772

我的 CentOS 服务器上的 MySQL 守护进程不断崩溃,我从 /var/logs/mysqld 获取了日志,但我仍然不确定如何解决这个问题:

    121114 16:22:56 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended                                                                                                 
    121114 21:55:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql                                                                                             
    121114 21:55:11 [Note] Plugin 'FEDERATED' is disabled.                                                                                                                            
    121114 21:55:11 InnoDB: The InnoDB memory heap is disabled                                                                                                                        
        121114 21:55:11 InnoDB: Mutexes and rw_locks

 use GCC atomic builtins                                                                                                              
    121114 21:55:11 InnoDB: Compressed tables use zlib 1.2.3                                                                                                                          
    121114 21:55:11 InnoDB: Using Linux native AIO                                                                                                                                    
    121114 21:55:11 InnoDB: Initializing buffer pool, size = 128.0M                                                                                                                   
    121114 21:55:11 InnoDB: Completed initialization of buffer pool                                                                                                                   
    121114 21:55:11 InnoDB: highest supported file format is Barracuda.                                                                                                               
    InnoDB: The log sequence number in ibdata files does not match                                                                                                                    
    InnoDB: the log sequence number in the ib_logfiles!                                                                                                                               
    121114 21:55:11  InnoDB: Database was not shut down normally!                                                                                                                     
    InnoDB: Starting crash recovery.                                                                                                                                                  
    InnoDB: Reading tablespace information from the .ibd files...                                                                                                                     
    InnoDB: Restoring possible half-written data pages from the doublewrite                                                                                                           
    InnoDB: buffer...                                                                                                                                                                 
    121114 21:55:12  InnoDB: Waiting for the background threads to start                                                                                                              
    121114 21:55:13 InnoDB: 1.1.6 started; log sequence number 77177262                                                                                                               
    121114 21:55:13 [Note] Event Scheduler: Loaded 0 events                                                                                                                           
    121114 21:55:13 [Note] /usr/libexec/mysqld: ready for connections.                                                                                                                
    Version: '5.5.12'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) by Remi                                                                          
    121115 00:19:44 mysqld_safe Number of processes running now: 0                                                                                                                    
    121115 00:19:44 mysqld_safe mysqld restarted                                                                                                                                      
    121115  0:19:47 [Note] Plugin 'FEDERATED' is disabled.                                                                                                                            
    121115  0:19:47 InnoDB: The InnoDB memory heap is disabled                                                                                                                        
    121115  0:19:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins                                                                                                              
    121115  0:19:47 InnoDB: Compressed tables use zlib 1.2.3                                                                                                                          
    121115  0:19:47 InnoDB: Using Linux native AIO                                                                                                                                    
    121115  0:19:47 InnoDB: Initializing buffer pool, size = 128.0M                                                                                                                   
    InnoDB: mmap(137363456 bytes) failed; errno 12                                                                                                                                    
    121115  0:19:47 InnoDB: Completed initialization of buffer pool                                                                                                                   
    121115  0:19:47 InnoDB: Fatal error: cannot allocate memory for the buffer pool                                                                                                   
    121115  0:19:47 [ERROR] Plugin 'InnoDB' init function returned error.                                                                                                             
    121115  0:19:47 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.                                                                                                  
    121115  0:19:47 [ERROR] Unknown/unsupported storage engine: InnoDB                                                                                                                
    121115  0:19:47 [ERROR] Aborting  

编辑 #1

             total       used       free     shared    buffers     cached                                                                                                         
Mem:           496        370        126          0         24        110                                                                                                         
-/+ buffers/cache:        234        261                                                                                                                                          
Swap:         1023          9       1014  

编辑#2

另外,我的 mysql 中最大的表是 20MB,所以我使用的内存应该是相当适中的。

SELECT CONCAT(table_schema, '.', table_name),
       CONCAT(ROUND(table_rows / 1000000, 2), 'M')                                    rows,
       CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G')                    DATA,
       CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G')                   idx,
       CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
       ROUND(index_length / data_length, 2)                                           idxfrac
FROM   information_schema.TABLES
ORDER  BY data_length + index_length DESC
LIMIT  10;

在此处输入图像描述

mysql
  • 1 1 个回答
  • 307 Views

1 个回答

  • Voted
  1. Best Answer
    Sc0rian
    2012-11-16T02:29:05+08:002012-11-16T02:29:05+08:00
    InnoDB: Fatal error: cannot allocate memory for the buffer pool
    

    从它的外观来看,您的服务器无法为 innodb 分配足够的内存。

    写入free -m以查看您必须分配多少内存。查看您的/etc/my.cnf并查看innodb_buffer_pool_size所做的更改。

    如果你愿意,你可以在没有 innodb 的情况下启动 mysql,有些人这样做是为了降低内存占用。mysqld --skip-innodb --default-storage-engine=myisam

    • 1

相关问题

  • 开源与专有关系 db mgt 系统的优缺点是什么?

  • 在 solaris 10 上为 mysql 设置 max_allowed_pa​​cket

  • 如何移动 MySQL 的数据目录?

  • 通过 VPN 连接什么是远程服务器 IP?

  • mysql崩溃

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve