Ubuntu – MariaDB-Server wont start after Server Reboot

mariadbMySQLUbuntu

I recently installed a Koha Library on Ubuntu VServer 16.04 with MariaDB 10.31.
Everything ran smoothly until the Root restarted: Now I get: Software error:

DBIx::Class::Storage::DBI::catch {…} (): DBI Connection failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1492. at /usr/share/koha/lib/Koha/Database.pm line 100

When i try to connect to the Site. I checked instantly if MySQL is running and it doesnt. So i tried to restart it – but i get an error

mysql status: 
mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mi 2017-10-18 20:08:06 CEST;     1min 26s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4640 ExecStart=/etc/init.d/mysql start (code=exited,         status=1/FAILURE)

Okt 18 20:07:36 h273239.stratoserver.net mysqld[4815]: 171018 20:07:36         [Note] InnoDB: Shutdown completed; log sequence number 19026477
Okt 18 20:07:36 h273239.stratoserver.net mysqld[4815]: 171018 20:07:36     [Note] /usr/sbin/mysqld: Shutdown complete
Okt 18 20:07:36 h273239.stratoserver.net mysqld[4815]:
Okt 18 20:07:36 h273239.stratoserver.net mysqld_safe[4850]: mysqld from pid         file /var/run/mysqld/mysqld.pid ended
Okt 18 20:08:06 h273239.stratoserver.net /etc/init.d/mysql[5123]: 0     processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf     ping' resulted in
Okt 18 20:08:06 h273239.stratoserver.net /etc/init.d/mysql[5123]: [61B blob     data]
Okt 18 20:08:06 h273239.stratoserver.net /etc/init.d/mysql[5123]: error:     'Can't connect to local MySQL server through socket '/var/run/mysqld    /mysqld.sock' (111 "Connection refused")'
Okt 18 20:08:06 h273239.stratoserver.net /etc/init.d/mysql[5123]: Check that     mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Okt 18 20:08:06 h273239.stratoserver.net /etc/init.d/mysql[5123]:
Okt 18 20:08:06 h273239.stratoserver.net mysql[4640]:    ...fail!

because we are a small NGO we cant pay for professional help – so you guys are my last resort – thanks in advance!

Best Answer

Try executing the following commands:

  • systemctl stop mysql.service; systemctl stop mysql.socket
  • killall mysqld
  • rm -f /var/run/mysqld/mysqld.sock
  • systemctl start mysql

Does it change anything? If not, please post the your last 100 lines of /var/log/messages (with tail -n 100)

Related Topic