From c1e1521b42bb2bb2ca87d12dc0cf426b5a4f1254 Mon Sep 17 00:00:00 2001 From: Mostafa Ghadamyari Date: Fri, 11 Mar 2022 18:41:21 +0330 Subject: [PATCH] made the mysql query compatible with v5.7 Updated the query according to https://dev.mysql.com/doc/refman/5.6/en/resetting-permissions.html and https://dev.mysql.com/doc/refman/5.7/en/set-password.html to make it compatible with both mysql v5.6 and v5.7 --- bin/v-change-database-host-password | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/v-change-database-host-password b/bin/v-change-database-host-password index a55a86bcd..fcd19a067 100755 --- a/bin/v-change-database-host-password +++ b/bin/v-change-database-host-password @@ -42,9 +42,9 @@ subj="v-change-database-host-password $*" case $type in mysql) mysql_connect $host; - query="USE mysql; UPDATE user SET" - query="$query password=PASSWORD('$dbpass')" - query="$query WHERE User='$dbuser';" + query="SET PASSWORD FOR" + query="$query '$dbuser'@'localhost'" + query="$query = PASSWORD('$dbpass');" query="$query FLUSH PRIVILEGES;" mysql_query "$query" ; if [ "$dbuser" == "root" ]; then