Page 1 of 1

MySQL Database server keeps crashing b/c of WP.

Posted: Thu Aug 16, 2018 7:06 pm
by AFN
A few days ago my web server completely crashed thankfully the day before it crashed I had backed up everything so I didn't really lose any data however I noticed today my web server specifically the MySQL server is constantly crashing.

The only thing that is using a database is WordPress, so I decided to disable all plugins to see if the problem was there apparently that doesn't seem to be in a problem it seems to be WordPress itself because I've been disabled WordPress by removing the wp-config page just by changing the name and then renaming the directory where WordPress is just to put a temporary page that says part of my sites can be unavailable anyway after taking my WordPress site offline I noticed that my database the mySQL database isn't crashing anymore so how would I be able to diagnose the problem and get this resolved?

Re: MySQL Database server keeps crashing b/c of WP.

Posted: Thu Aug 30, 2018 2:20 pm
by skamasle
Hi

Of course if you not have any site making request to mysql mysql may not fail

The problem here can be a corrupted table, try run mysqlcheck

Also check your mysql configuration, and check error log, be sure you run enough memory RAM and you not run out of space.

That are most comun problems, corrupted table or memory / space problem

Re: MySQL Database server keeps crashing b/c of WP.

Posted: Wed Oct 03, 2018 12:55 am
by AFN
How do I run mysqlcheck?

This is what the mysql configuration is (it's the /etc/my.cnf)

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 240K

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=50
max_user_connections=25
wait_timeout=10
interactive_timeout=50
long_query_time=5

#slow_query_log=1
#slow_query_log_file=/var/log/mysql-slow-queries.log

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


The error logs says

81002 14:39:18 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
181002 14:40:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181002 14:40:09 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 12744 ...
181002 14:40:09 InnoDB: The InnoDB memory heap is disabled
181002 14:40:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
181002 14:40:09 InnoDB: Compressed tables use zlib 1.2.7
181002 14:40:09 InnoDB: Using Linux native AIO
181002 14:40:09 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137756672 bytes) failed; errno 12
181002 14:40:09 InnoDB: Completed initialization of buffer pool
181002 14:40:09 InnoDB: Fatal error: cannot allocate memory for the buffer pool
181002 14:40:09 [ERROR] Plugin 'InnoDB' init function returned error.
181002 14:40:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
181002 14:40:09 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
181002 14:40:09 [Note] Plugin 'FEEDBACK' is disabled.
181002 14:40:09 [ERROR] Unknown/unsupported storage engine: InnoDB
181002 14:40:09 [ERROR] Aborting

181002 14:40:09 [Note] /usr/libexec/mysqld: Shutdown complete

181002 14:40:10 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

If this is a memory RAM and I am run out of space, how can I see if theses are the reason(s) and how can I increase this? Also why would this just now give me issues when this was not an issue before and it is only sometimes?