Clean installation of LibreNMS fails at the second boot

Hi everybody!

I just finished to install Librenms in my clean CentOS7 by following carefuily step by step this guide: https://docs.librenms.org/Installation/Installation-CentOS-7-Apache/
In the beginning everyting works just fine, I was even capable to add two devices to my monitoring system whit good results, but one reboot later, I find “Error connecting to database SQLSTATE[HY000] [2002] No such file or directory” in my navegator.

I went to the console to see:

"[root@localhost ~]# systemctl status mariadb
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[root@localhost ~]# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.
[root@localhost ~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-05-13 21:28:04 -03; 12s ago
Process: 5880 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
Process: 5878 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 5847 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 5878 (code=exited, status=0/SUCCESS)

May 13 21:27:58 localhost.localdomain systemd[1]: Starting MariaDB database server…
May 13 21:27:58 localhost.localdomain mariadb-prepare-db-dir[5847]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
May 13 21:27:58 localhost.localdomain mariadb-prepare-db-dir[5847]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
May 13 21:27:58 localhost.localdomain mysqld_safe[5878]: 190513 21:27:58 mysqld_safe Logging to ‘/var/log/mariadb/mariadb.log’.
May 13 21:27:58 localhost.localdomain mysqld_safe[5878]: 190513 21:27:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
May 13 21:28:04 localhost.localdomain systemd[1]: mariadb.service: control process exited, code=exited status=1
May 13 21:28:04 localhost.localdomain systemd[1]: Failed to start MariaDB database server.
May 13 21:28:04 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
May 13 21:28:04 localhost.localdomain systemd[1]: mariadb.service failed."

Did this happened to anybody? Well, what im realy want to know if it somebody has the solution.

Thanks in advance

A. you didn’t enable mariadb to start on boot
B. something is wrong with your mariadb service. Check the log it mentions. Maybe empty its directory and restart it and run ./lnms migrate and ./lnms user:add

1 Like