I’m facing an issue with " Fix db_port config in services-wrapper (#11284)" The fix does not resolve the issue when db port is set in configuration:
ERROR: Could not connect to MySQL database!
I removed the db_port from config.php for this to work.
[OK] Composer Version: 1.10.1
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
I have this setting in my config.php file:
$config[‘db_host’] = ‘db-host’;
$config[‘db_port’] = 3306;
What was your db_port setting?
Are you sure you have the latest version of the service-wrapper?
Hello, I have the same config as below in three librenms instances with the same services-wrapper.py version as you mentioned. I’m also in the latest stable version 1.62.2
This is my config:
$config[‘db_host’] = ‘localhost’;
$config[‘db_port’] = ‘3306’;
OK, the only difference I see is that I have
3306 which probably is interpreted as a number and you have
'3306' with apostrophe symbol which probably is read as a string.
The docs show it without apostrophe:
I should have used
intval in the code
To be honest i don’t remember if i ever added the apostrophe or if it was there from the initial installation. Config.php configuration utilizes more or less the same “format”. I removed the apostrophe and it works as expected.