# Mysqld stops unexpectedly



## c00kie (Sep 12, 2013)

Hi,

Every few months or so mysqld will just stop, unintentionally on my part you see. First off, I check the logs looking for clues:


```
120510 14:20:53 [Note] /usr/local/libexec/mysqld: Normal shutdown

120510 14:20:54 [Note] Event Scheduler: Purging the queue. 0 events
120510 14:20:54  InnoDB: Starting shutdown...
120510 14:20:54  InnoDB: Shutdown completed; log sequence number 1595675
120510 14:20:54 [Note] /usr/local/libexec/mysqld: Shutdown complete

120512  6:32:10 [Note] /usr/local/libexec/mysqld: Normal shutdown

120512  6:32:10 [Note] Event Scheduler: Purging the queue. 0 events
120512  6:32:10  InnoDB: Starting shutdown...
120512  6:32:10  InnoDB: Shutdown completed; log sequence number 1595675
120512  6:32:10 [Note] /usr/local/libexec/mysqld: Shutdown complete

120514 08:33:44 mysqld_safe mysqld from pid file /var/db/mysql/my.domain.net.pid ended
120514 08:35:01 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
120514  8:35:02 InnoDB: The InnoDB memory heap is disabled
120514  8:35:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120514  8:35:02 InnoDB: Compressed tables use zlib 1.2.5
120514  8:35:02 InnoDB: Initializing buffer pool, size = 128.0M
120514  8:35:02 InnoDB: Completed initialization of buffer pool
120514  8:35:02 InnoDB: highest supported file format is Barracuda.
120514  8:35:02  InnoDB: Waiting for the background threads to start
120514  8:35:03 InnoDB: 1.1.8 started; log sequence number 1595675
120514  8:35:03 [Note] Event Scheduler: Loaded 0 events
120514  8:35:03 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.5.23'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
120514  9:53:13 [Note] /usr/local/libexec/mysqld: Normal shutdown


120729  6:19:57 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!
120729  6:19:57  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...
120729  6:19:57  InnoDB: Waiting for the background threads to start
120729  6:19:58 InnoDB: 1.1.8 started; log sequence number 6565431
120729  6:19:58 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120729  6:19:58 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
120729  6:19:58 [Note] Server socket created on IP: '0.0.0.0'.
120729  6:19:58 [Note] Event Scheduler: Loaded 0 events
120729  6:19:58 [Note] /usr/local/libexec/mysqld: ready for connections.
```

The log seems to repeat, a lot of it is cryptic but one or two things stand out in particular:


```
120729  6:19:57  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
```

That'll be the unexpected shutdown I'd guess?

I restart with:
`/usr/local/etc/rc.d/mysql-server start`


```
130912 16:19:16 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
130912 16:19:17 InnoDB: The InnoDB memory heap is disabled
130912 16:19:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130912 16:19:17 InnoDB: Compressed tables use zlib 1.2.5
130912 16:19:17 InnoDB: Initializing buffer pool, size = 128.0M
130912 16:19:17 InnoDB: Completed initialization of buffer pool
130912 16:19:17 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!
130912 16:19:17  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...
130912 16:19:17  InnoDB: Waiting for the background threads to start
130912 16:19:18 InnoDB: 5.5.32 started; log sequence number 627520603
130912 16:19:18 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130912 16:19:18 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130912 16:19:18 [Note] Server socket created on IP: '0.0.0.0'.
130912 16:19:18 [Note] Event Scheduler: Loaded 0 events
130912 16:19:18 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.5.32'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
```

And all's back to normal; websites running fine. Can you advise on why my daemon or mysqld would shut down unexpectedly? I was under the impression that Unix servers just ran and ran and ran collecting dust since they were so reliable.


----------

