Currently running an apache server with wordpress. Keeps bringing up database error connection after a few minutes of doing anything. Attempted to get into mysql through command line. Keep getting error:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)
Error log dump:
140124 17:29:01 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:29:01 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:29:01 InnoDB: The InnoDB memory heap is disabled 140124 17:29:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:29:01 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:29:01 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:29:01 InnoDB: Completed initialization of buffer pool 140124 17:29:01 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:29:01 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:29:01 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:29:01 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:29:01 [ERROR] Aborting
140124 17:29:01 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:29:02 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:29:02 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:29:02 InnoDB: The InnoDB memory heap is disabled 140124 17:29:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:29:02 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:29:02 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:29:02 InnoDB: Completed initialization of buffer pool 140124 17:29:02 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:29:02 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:29:02 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:29:02 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:29:02 [ERROR] Aborting
140124 17:29:02 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:29:50 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:29:50 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:29:50 InnoDB: The InnoDB memory heap is disabled 140124 17:29:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:29:50 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:29:50 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:29:50 InnoDB: Completed initialization of buffer pool 140124 17:29:50 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:29:50 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:29:50 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:29:50 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:29:50 [ERROR] Aborting
140124 17:29:50 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:29:51 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:29:51 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:29:51 InnoDB: The InnoDB memory heap is disabled 140124 17:29:51 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:29:51 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:29:51 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:29:51 InnoDB: Completed initialization of buffer pool 140124 17:29:51 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:29:51 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:29:51 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:29:51 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:29:51 [ERROR] Aborting
140124 17:29:51 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:29:52 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:29:52 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:29:52 InnoDB: The InnoDB memory heap is disabled 140124 17:29:52 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:29:52 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:29:52 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:29:52 InnoDB: Completed initialization of buffer pool 140124 17:29:52 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:29:52 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:29:52 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:29:52 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:29:52 [ERROR] Aborting
140124 17:29:52 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:30:16 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:30:16 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:30:16 InnoDB: The InnoDB memory heap is disabled 140124 17:30:16 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:30:16 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:30:16 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:30:16 InnoDB: Completed initialization of buffer pool 140124 17:30:16 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:30:16 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:30:16 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:30:16 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:30:16 [ERROR] Aborting
140124 17:30:16 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:30:17 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:30:17 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:30:17 InnoDB: The InnoDB memory heap is disabled 140124 17:30:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:30:17 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:30:17 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:30:17 InnoDB: Completed initialization of buffer pool 140124 17:30:17 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:30:17 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:30:17 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:30:17 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:30:17 [ERROR] Aborting
140124 17:30:17 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:30:18 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:30:18 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:30:18 InnoDB: The InnoDB memory heap is disabled 140124 17:30:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:30:18 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:30:18 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:30:18 InnoDB: Completed initialization of buffer pool 140124 17:30:18 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:30:18 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:30:18 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:30:18 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:30:18 [ERROR] Aborting
140124 17:30:18 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:30:58 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:30:58 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:30:58 InnoDB: The InnoDB memory heap is disabled 140124 17:30:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:30:58 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:30:58 InnoDB: Initializing buffer pool, size = 128.0M 140124 17:30:58 InnoDB: Completed initialization of buffer pool 140124 17:30:58 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! 140124 17:30:58 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… 140124 17:30:59 InnoDB: Waiting for the background threads to start 140124 17:31:00 InnoDB: 5.5.34 started; log sequence number 20123319 140124 17:31:00 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 3306 140124 17:31:00 [Note] - ‘127.0.0.1’ resolves to ‘127.0.0.1’; 140124 17:31:00 [Note] Server socket created on IP: ‘127.0.0.1’. 140124 17:31:00 [Note] Event Scheduler: Loaded 0 events 140124 17:31:00 [Note] /usr/sbin/mysqld: ready for connections. Version: ‘5.5.34-0ubuntu0.12.04.1’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 (Ubuntu) 140124 17:35:14 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:35:14 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:35:14 InnoDB: The InnoDB memory heap is disabled 140124 17:35:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:35:14 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:35:14 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:35:14 InnoDB: Completed initialization of buffer pool 140124 17:35:14 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:35:14 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:35:14 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:35:14 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:35:14 [ERROR] Aborting
140124 17:35:14 [Note] /usr/sbin/mysqld: Shutdown complete
140124 17:35:15 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 140124 17:35:15 [Note] Plugin ‘FEDERATED’ is disabled. 140124 17:35:15 InnoDB: The InnoDB memory heap is disabled 140124 17:35:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140124 17:35:15 InnoDB: Compressed tables use zlib 1.2.3.4 140124 17:35:15 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:35:15 InnoDB: Completed initialization of buffer pool 140124 17:35:15 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:35:15 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:35:15 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:35:15 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:35:15 [ERROR] Aborting
140124 17:35:15 [Note] /usr/sbin/mysqld: Shutdown complete
root@Nostalgia:/var/log/mysql# tail /var/log/mysql/error.log InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:35:15 InnoDB: Completed initialization of buffer pool 140124 17:35:15 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:35:15 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:35:15 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:35:15 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:35:15 [ERROR] Aborting
140124 17:35:15 [Note] /usr/sbin/mysqld: Shutdown complete
root@Nostalgia:/var/log/mysql# mysql -u root -p Enter password: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) root@Nostalgia:/var/log/mysql# tail /var/log/mysql/error.log InnoDB: mmap(137363456 bytes) failed; errno 12 140124 17:35:15 InnoDB: Completed initialization of buffer pool 140124 17:35:15 InnoDB: Fatal error: cannot allocate memory for the buffer pool 140124 17:35:15 [ERROR] Plugin ‘InnoDB’ init function returned error. 140124 17:35:15 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 140124 17:35:15 [ERROR] Unknown/unsupported storage engine: InnoDB 140124 17:35:15 [ERROR] Aborting
140124 17:35:15 [Note] /usr/sbin/mysqld: Shutdown complete
Help would be nice :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
This is happening to me on a WordPress droplet. I’ve done two things, one suggested by another answer here. In the
[mysqld]
section I’ve addedinnodb_buffer_pool_size = 16M
. Note, this is really small, but this is on a small droplet, so it is what it is. Additionally, when mysql eventually crashed I noticed apache having a LOT of processes. It’s likely hogging up all the system memory. Again, this is for a small site, so I tuned down apache by editing/etc/apache2/mods-enabled/mpm_prefork.conf
to this:Updating
innodb_buffer_pool_size
stabilized the system for a lot longer than before, but apache eventually hogged all the memory. I’m hoping my problem goes away limiting the number of Apache processes that can exist.After applying the mysql and apache tweaks in my previous post I stressed the system using
ab
. Below are my results. Long story short, the system was able to successfully process 5000 requests across 20 concurrent connections. The system remained stable and no mysql issues.I’m running this on a 1G droplet, might be tight, but this config seems like it would work on a 512MB as well.
Hope this helps!
I’ve encountered similar issue, and adding 1GB swap solved my problem. See this: http://www.webtrafficexchange.com/solved-mysql-crash-fatal-error-cannot-allocate-memory-buffer-pool