Skip to content
Snippets Groups Projects
Commit c8667c4d authored by Till Brehm's avatar Till Brehm
Browse files

Fixed #4191 Updating database user password on MySQL 5.7 leads to "double hash"

How to reproduce issue
parent f66b6386
No related branches found
No related tags found
No related merge requests found
......@@ -140,7 +140,10 @@ class mysql_clientdb_plugin {
} elseif($action == 'RENAME') {
if(!$link->query("RENAME USER '".$link->escape_string($database_user)."'@'$db_host' TO '".$link->escape_string($database_rename_user)."'@'$db_host'")) $success = false;
} elseif($action == 'PASSWORD') {
if(!$link->query("SET PASSWORD FOR '".$link->escape_string($database_user)."'@'$db_host' = '".$link->escape_string($database_password)."'")) $success = false;
//if(!$link->query("SET PASSWORD FOR '".$link->escape_string($database_user)."'@'$db_host' = '".$link->escape_string($database_password)."'")) $success = false;
// SET PASSWORD for already hashed passwords is not supported by latest MySQL 5.7 anymore, so we set it directly
if(!$link->query("UPDATE mysql.user SET `Password` = '".$link->escape_string($database_password)."' WHERE `Host` = '".$db_host."' AND `User` = '".$link->escape_string($database_user)."'")) $success = false;
if($success == true) $link->query("FLUSH PRIVILEGES");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment