From 92f07eb66c4b967f346b927e4b0afba00456e5d2 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sun, 12 Mar 2017 09:00:30 +0100 Subject: [PATCH] Install: fix db connection as admin check (#1049) Commit 42718557933d1e58fc134ef3bea7db97aeb00c65 (issue #22400) introduced a regression in the installer, causing the 'Attempting to connect to database as admin' check to fail for new installations, even though the Admin user ID and password are correct. Fixes #22510 --- admin/install.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/install.php b/admin/install.php index 7aad216fde..4fcec7f5ea 100644 --- a/admin/install.php +++ b/admin/install.php @@ -408,17 +408,17 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes $t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password ); if( $t_result ) { - # check if db exists for the admin - $t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password, $f_database_name ); - } - if( $t_result ) { - $t_db_open = true; - $f_db_exists = true; - # due to a bug in ADODB, this call prompts warnings, hence the @ # the check only works on mysql if the database is open $t_version_info = @$g_db->ServerInfo(); + # check if db exists for the admin + $t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password, $f_database_name ); + if( $t_result ) { + $t_db_open = true; + $f_db_exists = true; + } + print_test_result( GOOD ); } else { print_test_result( BAD, true, 'Does administrative user have access to the database? ( ' . db_error_msg() . ' )' );