mariadb down

mariadb down

Rocky Richard -
回帖数:4

Hi

I install moodle 3.2.1 on my centos.

All are ok.

But my moodle usually database down.

ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION 

/var/lib/mysql/mysql.sock' (111 "Connection refused")


At that time, I restart my centos. It is ok now.

But after sometime, sql down again.


I run the following command to fix.

#chown -R mysql. /var/lib/mysql/ 

#mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql


But don't work. 伤心


回复Rocky Richard

Re: mariadb down

Ken Task -
Particularly helpful Moodlers的头像

CentOS is?  6 or 7?

There should be a mysql_log file in /var/log/  and  a mysql.err log in /var/lib/mysql.  Check those

Are you using DB clusters or DB replication?

What does your moodle config.php file have for DB setup?

'spirit of sharing', Ken


回复Rocky Richard

Re: mariadb down

Dan Bennett -

So MariaDB is enabled and started fine on boot, but at some point it appears to have stopped?

If you run systemctl status mariadb when you get this error, what is the result? If it is inactive, it may state since when, so you can correlate that with other logs.

If you check mysql.err log in /var/lib/mysql as per Ken's suggestion you may find an error there. If empty, you may need to define this in my.cnf log-error = /path/to/error/log

It may also be worth checking the error logs for Apache (or whatever you are using) to see if anything triggered MariaDB to stop.

回复Dan Bennett

Re: mariadb down

Rocky Richard -

Thanks, Dan.

there is no mysql.err in /var/lib/mysql. 

So I reinstall moodle 3.3 on my centos7 again.

Now my moodle is still fine. Thanks.