1
0
Fork 0

fix access denied error

in contrast to mysql_connect, it is not allowed to attach the port or the socket to the host name for the mysqli_connect command. There are separate parameters for that now. This leads to "Access denied for user 'user123'@'localhost' (using password: NO) " errors in the current version if port or socket is specified
Dieser Commit ist enthalten in:
e-dschungel 2017-01-24 23:36:11 +01:00 committet von GitHub
Ursprung 70a5a25d9a
Commit f3df681903
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -252,9 +252,9 @@ function MSD_mysql_connect($encoding='utf8', $keycheck_off=false, $actual_table=
if (isset($config['dbconnection']) && is_resource($config['dbconnection'])) {
return $config['dbconnection'];
}
$port=( isset($config['dbport']) && !empty($config['dbport']) ) ? ':' . $config['dbport'] : '';
$socket=( isset($config['dbsocket']) && !empty($config['dbsocket']) ) ? ':' . $config['dbsocket'] : '';
$config['dbconnection']=@($GLOBALS["___mysqli_ston"] = mysqli_connect($config['dbhost'] . $port . $socket, $config['dbuser'], $config['dbpass'])) or die(SQLError("Error establishing a database connection!", ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))));
$port=( isset($config['dbport']) && !empty($config['dbport']) ) ? $config['dbport'] : '';
$socket=( isset($config['dbsocket']) && !empty($config['dbsocket']) ) ? $config['dbsocket'] : '';
$config['dbconnection']=($GLOBALS["___mysqli_ston"] = mysqli_connect($config['dbhost'], $config['dbuser'], $config['dbpass'], "", $port, $socket)) or die(SQLError("Error establishing a database connection!", ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))));
if (!defined('MSD_MYSQL_VERSION')) GetMySQLVersion();
if (!isset($config['mysql_standard_character_set']) || $config['mysql_standard_character_set'] == '') get_sql_encodings();