I'm running CentOS 6 with Apache/PHP/MySQL. PS. I'm sort of a novice at Linux, but I did my best to gather info before coming here. I'm now a bit stuck.

  • I recently upgraded PHP to version 5.5.12.
  • I had previously upgraded MySQL to version 5.6. However, this issue didn't begin until I later did the PHP upgrade mentioned above.

Nearly every day, and sometimes multiple times per day, my website will start displaying the following in the browser, in place of any website content:

Connection Failed: 2002

I read that this is probably generated by MySQL. The error persists until I manually restart mysqld. This is starting to happen more and more frequently, sometimes several times per hour.

Here is a relevant section of my MySQL error log from one of those occurrences (they all pretty much look like this):

2014-07-28 11:22:46, , mysqld_safe, Number of processes running now: 0
2014-07-28 11:22:46, , mysqld_safe, mysqld restarted
2014-07-28 11:22:52, 0, Warning, TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-28 11:22:52, 1503, Note, Plugin 'FEDERATED' is disabled.
2014-07-28 11:22:52, 1503, Note, InnoDB: Using atomics to ref count buffer pool pages
2014-07-28 11:22:52, 1503, Note, InnoDB: The InnoDB memory heap is disabled
2014-07-28 11:22:52, 1503, Note, InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-28 11:22:52, 1503, Note, InnoDB: Compressed tables use zlib 1.2.3
2014-07-28 11:22:52, 1503, Note, InnoDB: Using Linux native AIO
2014-07-28 11:22:52, 1503, Note, InnoDB: Using CPU crc32 instructions
2014-07-28 11:22:52, 1503, Note, InnoDB: Initializing buffer pool, size = 128.0M
, , , InnoDB: mmap(137363456 bytes) failed; errno 12
2014-07-28 11:22:52, 1503, ERROR, InnoDB: Cannot allocate memory for the buffer pool
2014-07-28 11:22:52, 1503, ERROR, Plugin 'InnoDB' init function returned error.
2014-07-28 11:22:52, 1503, ERROR, Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-07-28 11:22:52, 1503, ERROR, Unknown/unsupported storage engine: InnoDB
2014-07-28 11:22:52, 1503, ERROR, Aborting

This is not from the initial mysqld run at bootup -- that one starts fine. It looks like mysqld is starting itself again at random times (I'm not sure if that's normal?) and encountering this error.

PS. I can trigger the error by running this:

$ valgrind mysqld

...which in the SSH console returns:

1868 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

This replaces my website with Connection Failed: 2002 the same way, but I'm not sure if that happens for the same reason as the random occurrences. I figured I'd mention this just in case it provides clues.

  • stackoverflow.com/a/1676741/1742825 – Ramesh Jul 28 '14 at 13:41
  • 2
    mmap(137363456 bytes) failed; errno 12 - you're really short on RAM. (errno 12 is ENOMEM.) – Mat Jul 28 '14 at 13:41
  • @Mat Thanks. I started lowering MySQL buffer and cache sizes and things seem to have stabilized for the most part. I also added a cron job to check if mysqld is running every minute and restart it if it's not. – equazcion Jul 29 '14 at 11:47
  • @Mat would you like to add your comment as an Answer? – Jeff Schaller Aug 13 '16 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.