Mysql state error

Hi everybody,

When i tried to access to an application i have the following error message :

Internal Error: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)

I have looked on the mysql service and the service is stopped. The log on yunohost admin panel for mysql are empty.

When i’m connecting to the server via ssh and tried to start mysql i have the following error :

systemctl status mysql.service -l
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Fri 2017-08-11 11:09:29 CEST; 36s ago
Process: 16858 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Aug 11 11:09:29 yourDomain.net /etc/init.d/mysql[17389]: 0 processes alive and ‘/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping’ resulted in
Aug 11 11:09:29 yourDomain.net mysql[16858]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Aug 11 11:09:29 yourDomain.net systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 11 11:09:29 yourDomain.net systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Aug 11 11:09:29 yourDomain.net systemd[1]: Unit mysql.service entered failed state.

and
journalctl -xn

– Logs begin at Thu 2017-08-10 21:18:35 CEST, end at Fri 2017-08-11 11:28:30 CEST. –
Aug 11 11:28:17 yourDomain.net sshd[17848]: PAM 1 more authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.51.9.156 user=root
Aug 11 11:28:30 yourDomain.net /etc/init.d/mysql[18040]: 0 processes alive and ‘/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping’ resulted in
Aug 11 11:28:30 yourDomain.net /etc/init.d/mysql[18040]: [61B blob data]
Aug 11 11:28:30 yourDomain.net /etc/init.d/mysql[18040]: error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)’
Aug 11 11:28:30 yourDomain.net /etc/init.d/mysql[18040]: Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!
Aug 11 11:28:30 yourDomain.net /etc/init.d/mysql[18040]:
Aug 11 11:28:30 yourDomain.net mysql[17613]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Aug 11 11:28:30 yourDomain.net systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 11 11:28:30 yourDomain.net systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
– Subject: Unit mysql.service has failed
– Defined-By: systemd
– Support: systemd-devel Info Page

– Unit mysql.service has failed.

– The result is failed.
Aug 11 11:28:30 yourDomain.net systemd[1]: Unit mysql.service entered failed state.

Please could you help me ?

Hello,

I had the same issue a few weeks ago.

On a shell, what is the result of :

sudo cat /var/lib/mysql/yunohost.err

?