Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

The MySQL daemon on my CentOS server keeps crashing, i got the logs from /var/logs/mysqld but still i am not sure how to fix this:

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 
share|improve this question
    
This doesn't look like it's crashing, but being restarted. Do you have any cronjobs running at around that time? –  Derek Downey Nov 15 '12 at 14:08
    
Of course, then I read the rest of the log. Can you give your specs on the centos machine (RAM) and what other processes you run on it (apache/php/etc)? 128MB innodb buffer pool should not be causing a memory issue. –  Derek Downey Nov 15 '12 at 14:11
add comment

1 Answer

This is not actually MySQL crashing.

It's running...

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 

...and then it's not running...

121115 00:19:44 mysqld_safe Number of processes running now: 0  

If MySQL were crashing, you would almost certainly see messages between those two entries.

This, also, is not MySQL crashing:

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

This is MySQL trying to restart after being killed, but unable to restart because your system doesn't have enough available memory at that moment.

See this post and this post for an explanation of what's happening... you should find entries in /var/log/messages indicating that the kernel is deliberately killing mysqld due to an overall shortage of system memory... most likely caused by your web server making heavy demands for memory.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.