MySQL Daemon failed to start.

November 28, 2013 10.8k views
Recently I started working on a very basic Drupal website for a friend, by doing that it sadly seems that it has overloaded mysql. Can it really be that 1 Drupal install on a 512mb droplet eats up all the swap? Anyway, I'm running CentOS with NginX, php-fpm, mysqld. I've checked the mysqld.log and every time I try "service mysqld restart" this is what shows up in the log: -------------------------------------------------------------------------------- 131128 22:05:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 131128 22:05:57 [Note] Plugin 'FEDERATED' is disabled. 131128 22:05:57 InnoDB: The InnoDB memory heap is disabled 131128 22:05:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins 131128 22:05:57 InnoDB: Compressed tables use zlib 1.2.3 131128 22:05:57 InnoDB: Using Linux native AIO 131128 22:05:57 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 131128 22:05:57 InnoDB: Completed initialization of buffer pool 131128 22:05:57 InnoDB: Fatal error: cannot allocate memory for the buffer pool 131128 22:05:57 [ERROR] Plugin 'InnoDB' init function returned error. 131128 22:05:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 131128 22:05:57 [ERROR] Unknown/unsupported storage engine: InnoDB 131128 22:05:57 [ERROR] Aborting 131128 22:05:57 [Note] /usr/libexec/mysqld: Shutdown complete 131128 22:05:57 mysqld_safe mysqld from pid file /var/run/mysqld/ ended -------------------------------------------------------------------------------- To my knowledge, it seems that it can't load into swap or something similar to that, but I could be wrong. Anyone know how I can solve this?
5 Answers
To resolve my problem I just had to upgrade my droplet to have more memory, just leaving this comment here in case anyone else is having the same issue
The core of the error is InnoDB failing to allocate memory for its pool.

If you have recently upgraded your MySQL version from 5.5 to 5.6 or freshly installed 5.6.
Then you might be experiencing the outcome of recent MySQL default configuration change -
As of 5.6 Performance Schema is On by default - In 5.5 it was Off
Try by manually turning it of in your config
performance_schema = off
Add performance_schema = off to MySQL confiugration file solved the issue!
I tried setting performance_schema=off in my.cnf yet that only results in mysql not wanting to start at all, with this error in the log:

131227 0:24:06 [ERROR] /usr/libexec/mysqld: unknown variable 'performance_schema=off'
131227 0:24:06 [ERROR] Aborting

Which just confuses me, after checking what version of Mysql I'm running, it's 5.1.71 (which is the version that is installed via the guide for CentOS LAMP server) and yum doesn't return a newer version, should I upgrade to a newer version to solve my issue or could it be elsewhere?
Never mind, updated to mysql 5.5 and now the performance_schema=off works, thanks for the help :)
Have another answer? Share your knowledge.