Mysql crash problems on EC2 AWS micro instance

If you have the default mysql config probably you’ll have some crash problems after a while running the instance.

I’m running a micro instance, with Ubuntu 12.04 and default mysql installation.

I’ve this logs reports:

[Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.7
InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
InnoDB: Completed initialization of buffer pool
InnoDB: Fatal error: cannot allocate memory for the buffer pool
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

[Note] /usr/sbin/mysqld: Shutdown complete

 

To solve it you need to add some lines on the /etc/mysql/my.cnf file after the [mysql] line:

innodb_buffer_pool_size = 40M
key_buffer_size=10M
max_connections=5

Also it’s recommended to run a repair table on each of your databases after changing the mysql settings and restart the mysqld service.

Published by

Nicolás Bistolfi

CEO at Piio

One thought on “Mysql crash problems on EC2 AWS micro instance”

Leave a Reply

Your email address will not be published. Required fields are marked *


*