Hi all Iam running my magento site in amazon ec2 linus free tier instance.
I'm having issues starting MySQL after it randomly stopped working a few minutes ago. I'm getting this error while trying to connect:
SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)
So I tried to restart MySQL (this had worked for me before) and I got this:
Stopping mysqld: [ OK ] MySQL Daemon failed to start. Starting mysqld: [FAILED]
Here is my mysql error logs
140707 15:04:09 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140707 15:04:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140707 15:04:10 [Note] Plugin 'FEDERATED' is disabled.
140707 15:04:10 InnoDB: The InnoDB memory heap is disabled
140707 15:04:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140707 15:04:10 InnoDB: Compressed tables use zlib 1.2.7
140707 15:04:10 InnoDB: Using Linux native AIO
140707 15:04:10 InnoDB: Initializing buffer pool, size = 128.0M
140707 15:04:10 InnoDB: Completed initialization of buffer pool
140707 15:04:10 InnoDB: highest supported file format is Barracuda.
140707 15:04:10 InnoDB: Waiting for the background threads to start
140707 15:04:11 InnoDB: 5.5.38 started; log sequence number 14130260
140707 15:04:11 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140707 15:04:11 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140707 15:04:11 [Note] Server socket created on IP: '0.0.0.0'.
140707 15:04:11 [Note] Event Scheduler: Loaded 0 events
140707 15:04:11 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.38' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
140707 18:32:03 mysqld_safe Number of processes running now: 0
140707 18:32:03 mysqld_safe mysqld restarted
140707 18:32:04 [Note] Plugin 'FEDERATED' is disabled.
140707 18:32:05 InnoDB: The InnoDB memory heap is disabled
140707 18:32:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140707 18:32:05 InnoDB: Compressed tables use zlib 1.2.7
140707 18:32:05 InnoDB: Using Linux native AIO
140707 18:32:05 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140707 18:32:05 InnoDB: Completed initialization of buffer pool
140707 18:32:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140707 18:32:05 [ERROR] Plugin 'InnoDB' init function returned error.
140707 18:32:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140707 18:32:05 [ERROR] Unknown/unsupported storage engine: InnoDB
140707 18:32:05 [ERROR] Aborting
Here is my etc/my.cnf file
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock
#Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0
#Settings user and group are ignored when systemd is used.
#If you need to run mysqld under a different user or group,
#customize your systemd unit file for mysqld according to the
#instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
In var/lib/mysql i can't find mysql.sock file for logs.But my default socket is pointing towards var/lib/mysql/mysql.sock
My mysql version (5.5)
if i type command
mysql --version it displays
mysql Ver 14.14 Distrib 5.5.38, for Linux (x86_64) using readline 5.1
please suggest me what to do. I get this error time to time, for few hours my site worked fine and i get this error after some time so please suggest me how to resolve this issue permanently.
If you need any other details please list me.
Thanks in advance.
The problem was mainly due to less processing speed and memory space, so i did swapping which cleared some space in the server and that did the trick.