I have LAMP setup running on ubuntu. I am using this setup to run torrentflux with a web interface that requires mysql.
All works as expected for a few days, and then I get ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)’
I rebooted to fix the problem, but now the inconvenience of doing so has surpassed the reward of solving the problem, and I would like to find another way to solve the problem.
Mysql is the only failure in the LAMP setup for torrentflux. Torrentflux still leeches and seeds as it should; I simply lose the control interface without mysql. Apache still does its thing as expected.
Yes, mysql is running until the error is output when I try to use the web interface, and then it is impossible to restart the mysql server.
$ sudo service mysql start
start: Job failed to start
Ubuntu version:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise
G/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
130126 14:42:15 [Note] Plugin 'FEDERATED' is disabled.
130126 14:42:15 InnoDB: The InnoDB memory heap is disabled
130126 14:42:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130126 14:42:15 InnoDB: Compressed tables use zlib 1.2.3.4
130126 14:42:16 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130126 14:42:16 InnoDB: Completed initialization of buffer pool
130126 14:42:16 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130126 14:42:16 [ERROR] Plugin 'InnoDB' init function returned error.
130126 14:42:16 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130126 14:42:16 [ERROR] Unknown/unsupported storage engine: InnoDB
130126 14:42:16 [ERROR] Aborting
mysql was running until I shut it down.
Rebooting fixes the problem for a while. I wish for a less drastic solution.
EDIT: You changed your question around a bit, so moved the old answer down below.
Either way, what you’re getting in the log is fairly clear;
errno 12means you’re out of memory. MySQL tries to allocate 128MB for the buffer pool, but can’t find that much free memory.I’m not sure what kind of machine you’re running on, but you basically have 3 options;
Old answer before edit;
You’re getting that message because you’re trying to start MySQL as your normal user, not as root as required.
Try;