mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: support non-standard unix socket (#5724)
* Add support for custom MySQL unix-socket * NULL must be lowercase! * Naive edit of html/install.php * fixup * Refactor dbConnect Use it everywhere * $config needs to be global Don't need to set $database_link * small cleanups
This commit is contained in:
committed by
Neil Lathwood
parent
66d9d54f73
commit
b1a414e785
10
validate.php
10
validate.php
@@ -158,12 +158,14 @@ if (isset($config['user'])) {
|
||||
}
|
||||
|
||||
// Run test on MySQL
|
||||
$test_db = @mysqli_connect($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name'], $config['db_port']);
|
||||
if (mysqli_connect_error()) {
|
||||
print_fail('Error connecting to your database '.mysqli_connect_error());
|
||||
} else {
|
||||
try {
|
||||
dbConnect();
|
||||
print_ok('Database connection successful');
|
||||
} catch (\LibreNMS\Exceptions\DatabaseConnectException $e) {
|
||||
print_fail('Error connecting to your database '.$e->getMessage());
|
||||
}
|
||||
// pull in the database config settings
|
||||
mergedb();
|
||||
|
||||
// Test for MySQL Strict mode
|
||||
$strict_mode = dbFetchCell("SELECT @@global.sql_mode");
|
||||
|
||||
Reference in New Issue
Block a user