From d4e405b1fa00789599a5404e0ca1189f19d90be6 Mon Sep 17 00:00:00 2001 From: Mos GH Date: Thu, 21 Dec 2017 09:43:04 -0500 Subject: [PATCH] Added updating .my.cnf file when changing root password --- bin/v-change-database-host-password | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/v-change-database-host-password b/bin/v-change-database-host-password index fc066293..a55a86bc 100755 --- a/bin/v-change-database-host-password +++ b/bin/v-change-database-host-password @@ -46,7 +46,11 @@ case $type in query="$query password=PASSWORD('$dbpass')" query="$query WHERE User='$dbuser';" query="$query FLUSH PRIVILEGES;" - mysql_query "$query" ;; + mysql_query "$query" ; + if [ "$dbuser" == "root" ]; then + echo -e "[client]\npassword='$dbpass'\n" > /root/.my.cnf + chmod 600 /root/.my.cnf + fi;; pgsql) echo "TBD" >/dev/null;; esac