rmc008
By:
rmc008

WordPress "Errorr Establishing Database Connection", but RAM not maxing out?

October 2, 2017 112 views
WordPress Ubuntu

I notice that my site will suddenly lose connection the database, and I am getting duplicates of memory allocation errors for MySQL:

/var/log/mysql/error.log:2017-10-02T13:10:21.353353Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T15:42:16.056060Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T16:55:46.662608Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T19:16:24.149783Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T19:17:10.792244Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T19:51:20.955971Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T20:15:03.484067Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T20:32:16.391206Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T21:27:58.671734Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T21:34:31.399781Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T21:36:33.327737Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log:2017-10-02T22:27:51.775016Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.1.gz:2017-10-02T00:49:55.833472Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.1.gz:2017-10-02T04:10:20.862142Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.1.gz:2017-10-02T04:26:37.263526Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.1.gz:2017-10-02T05:51:23.789589Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.1.gz:2017-10-02T05:52:37.946939Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.2.gz:2017-09-30T19:15:42.362225Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.2.gz:2017-09-30T19:52:08.886413Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.2.gz:2017-09-30T21:29:35.562156Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.2.gz:2017-09-30T23:45:05.934152Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.2.gz:2017-09-30T23:46:30.960428Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.2.gz:2017-10-01T00:17:27.374200Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.3.gz:2017-09-29T23:32:45.927580Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.3.gz:2017-09-30T00:01:10.947048Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.3.gz:2017-09-30T00:08:53.977391Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.3.gz:2017-09-30T02:47:15.425839Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.3.gz:2017-09-30T02:47:45.397181Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.4.gz:2017-09-28T17:20:11.137190Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.5.gz:2017-09-28T05:17:25.361818Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
/var/log/mysql/error.log.5.gz:2017-09-28T05:35:51.610811Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool

Strangely the DigitalOcean dashboard does not show my memory surpassing ~66%. What is the issue here?

Here's an image of my dashboard within the past 6 hours:
https://i.imgur.com/aY5aYiC.png

1 Answer
rmc008 October 3, 2017
Accepted Answer

WordPress had been set only 128MB of RAM in the wp-config.php file. I have mostly fixed the issue by raising it to 256MB, and changed around some mysql.sock settings in the php.ini file (which were missing for some reason).

Have another answer? Share your knowledge.