MariaDB is down randomly - Error establishing a database connection for all the websites

Since last week I updated one of my Wordpress/WooCommerce site to the latest version, my MariaDB server starts to be down randomly, from 1 day to 4 days.

I have 4 websites hosted in the server.

The error message of db as below
“kernel: [5855606.614002] Out of memory: Kill process 31213 (mysqld) score 87 or sacrifice child
kernel: [5855606.618908] Killed process 31213 (mysqld) total-vm:1031248kB, anon-rss:351016kB, file-rss:0kB
systemd[1]: mariadb.service: Main process exited, code=killed, status=9/KILL
systemd[1]: mariadb.service: Unit entered failed state.
systemd[1]: mariadb.service: Failed with result ‘signal’.
systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped MariaDB 10.1.46 database server.
systemd[1]: Starting MariaDB 10.1.46 database server…
mysqld[11907]: 2020-12-20 22:26:06 140448597747968 [Note] /usr/sbin/mysqld (mysqld 10.1.46-MariaDB-1~xenial) starting as process 11907 …
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: The InnoDB memory heap is disabled
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: Compressed tables use zlib 1.2.8
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: Using Linux native AIO
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: Using SSE crc32 instructions
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] InnoDB: Initializing buffer pool, size = 256.0M
mysqld[11907]: InnoDB: mmap(281149440 bytes) failed; errno 12
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [ERROR] Plugin ‘InnoDB’ init function returned error.
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [Note] Plugin ‘FEEDBACK’ is disabled.
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [ERROR] Unknown/unsupported storage engine: InnoDB
mysqld[11907]: 2020-12-20 22:26:07 140448597747968 [ERROR] Aborting
systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start MariaDB 10.1.46 database server.
systemd[1]: mariadb.service: Unit entered failed state.
systemd[1]: mariadb.service: Failed with result ‘exit-code’.”

It seems out of memory and cannot allocate memory for the buffer pool.

I have to execute “sudo service mysql restart” manually to restart the db server.

Anyone know what’s possible reason to cause the issue and how to fix it?

Many thanks!!

Hey @Cloris,

Welcome to EE Community. You can use ee service command to manage MySQL. i.e

ee service disable global-db && ee service enable global-db
ee service restart global-db
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.