Hello,
I Have issue when installing librenms on centos 7 on step 2.
The error are : Could not connect to database, check logs/librenms.log.
I’m sure that user&pass mysql is correct.
When i see these log it says,
[2018-09-12 08:54:01] production.ERROR: PDOException: SQLSTATE[HY000] [2002] No such file or directory in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(68): PDO->__construct(‘mysql:host=;por…’, ‘’, ‘’, Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(44): Illuminate\Database\Connectors\Connector->createPdoConnection(‘mysql:host=;por…’, ‘’, ‘’, Array)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection(‘mysql:host=;por…’, Array, Array)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(883): call_user_func(Object(Closure))
#6 /opt/librenms/LibreNMS/DB/Eloquent.php(110): Illuminate\Database\Connection->getPdo()
#7 /opt/librenms/includes/init.php(108): LibreNMS\DB\Eloquent::isConnected()
#8 /opt/librenms/alerts.php(31): require(’/opt/librenms/i…’)
#9 {main}
Any clue how to fix it ?
You should not get errors like that, must be a bug. It seems your credentials are incorrect.
You clear your browser cookies and try again with install.php or you can create config.php by hand and run ./build-base.php
and ./adduser.php
.
Thanks for your support.
I think i found the issue on /etc/hosts
After i ./adduser it seems that i could not login to librenms
Any thing can i do ?
run ./validate.php and check the output. Or delete config.php and go through install.php again.
I’m sorry … it seems that i’m unable to use install.php again
After ./validate.php my account don’t have permission to add device event on level 10.
Add a new user with level 10, you cannot edit a user from the CLI. Then once logged in change your user to level 10.
hi,
nothing i can do after login, permission not allowed
So, how many users have you added now? It should be at least 2.
Thanks for your support, i think i have another issue then.
It seems that device that i add not showing anything … in fact i have warning devices in not polled.
====================================
Component |
Version |
LibreNMS |
1.43-61-gc222d0e |
DB Schema |
267 |
PHP |
7.0.31 |
MySQL |
10.3.9-MariaDB |
RRDTool |
1.4.8 |
SNMP |
NET-SNMP 5.7.2 |
====================================
[OK] Composer Version: 1.7.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX] You can fix this with ./scripts/github-remove
Modified Files:
rrd/.gitignore
librenm.log :
[2018-09-13 12:38:42] production.ERROR: 8 /opt/librenms/html/pages/devices.inc.php:469 Undefined index: section
[2018-09-13 12:38:42] production.ERROR: 8 /opt/librenms/html/pages/devices.inc.php:469 Undefined index: bare
[2018-09-13 12:38:42] production.ERROR: 8 /opt/librenms/html/legacy_index.php:271 Undefined variable: no_refresh
/opt/librenms/discovery.php new 2018-09-13 12:40:01 - 0 devices discovered in 0.001 secs
/opt/librenms/poller.php 2 2018-09-13 12:40:03 - 1 devices polled in 2.276 secs
[2018-09-13 12:40:30] production.ERROR: 8 /opt/librenms/html/legacy_index.php:113 Undefined index: custom_css
[2018-09-13 12:40:30] production.ERROR: 8 /opt/librenms/html/pages/authlog.inc.php:10 Undefined variable: bg
[2018-09-13 12:40:30] production.ERROR: 8 /opt/librenms/html/legacy_index.php:271 Undefined variable: no_refresh
/opt/librenms/discovery.php new 2018-09-13 12:45:01 - 0 devices discovered in 0.001 secs
/opt/librenms/poller.php 2 2018-09-13 12:45:04 - 1 devices polled in 2.269 secs
Any clue ?