I know that there are lots of questions about this out there but unfortunately none of the solution seems to fix my problem. I have been spending lot of time finding the solution and did not achieve much from my reading with my limited knowledge.
I am using Amazon free tier and hosting a Wordpress site. I have installed LAMP and Wordpress. The website is now in the development mode. Initially everything was good but after some time suddenly I started to receive problem of Error Establishing Database Connection very frequent.
Some findings when the problem appeared:
sudo service mysqld status
returnedmysqld dead but subsys locked
Deeper in the log:
InnoDB: Initializing buffer pool, size = 10.0M InnoDB: mmap(10731520 bytes) failed; errno 12 InnoDB: Completed initialization of buffer pool InnoDB: Fatal error: cannot allocate memory for the buffer pool Completed initialization of buffer pool InnoDB: Fatal error: cannot allocate memory for the buffer pool [ERROR] Plugin 'InnoDB' init function returned error. [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. [ERROR] Unknown/unsupported storage engine: InnoDB [ERROR] Aborting /usr/libexec/mysql55/mysqld: Shutdown complete
So what I have done are as below but none of them works for me yet:
- Restart
httpd
andmysqld
>>>>> OK for few minutes then got the problem again - Make swap file of 1GB >>>>> even 2GB did not work for me. OK for a while (few hours) but the problem come back
- Decreased
innodb_buffer_pool_size
down to 10MB but still not happy
I really have no idea on how to sort this issue. What I realized is whenever I start on the new server, it is good for a while then the problem comes. Any help and guidance are greatly appreciated.
Thanks.