diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 53cde17982..2b2cf60a9f 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -899,6 +899,11 @@ if (! defined('PMA_MINIMUM_COMMON')) { unset($login_without_password_is_forbidden); //Clean up after you! } + // if using TCP socket is not needed + if (strtolower($cfg['Server']['connect_type']) == 'tcp') { + $cfg['Server']['socket'] = ''; + } + // Try to connect MySQL with the control user profile (will be used to // get the privileges list for the current user but the true user link // must be open after this one so it would be default one for all the diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index b017e103bb..ba01cf10c0 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -72,10 +72,6 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu : ':' . $cfg['Server']['socket']; } - if (strtolower($cfg['Server']['connect_type']) == 'tcp') { - $cfg['Server']['socket'] = ''; - } - $client_flags = 0; // always use CLIENT_LOCAL_FILES as defined in mysql_com.h diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 0cd7c2f6dd..c9f02bb454 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -74,11 +74,6 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu : $GLOBALS['cfg']['Server']['socket']; } - - if (strtolower($GLOBALS['cfg']['Server']['connect_type']) == 'tcp') { - $GLOBALS['cfg']['Server']['socket'] = ''; - } - // NULL enables connection to the default socket $link = mysqli_init();