summaryrefslogtreecommitdiff
path: root/scripts/mysql_secure_installation.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mysql_secure_installation.sh')
-rw-r--r--scripts/mysql_secure_installation.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index 57e4d43dfad..1bd21513d4d 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -304,7 +304,7 @@ set_root_password() {
fi
esc_pass=`basic_single_escape "$password1"`
- do_query "UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root';"
+ do_query "UPDATE mysql.global_priv SET priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', PASSWORD('$esc_pass')) WHERE User='root';"
if [ $? -eq 0 ]; then
echo "Password updated successfully!"
echo "Reloading privilege tables.."
@@ -324,7 +324,7 @@ set_root_password() {
}
remove_anonymous_users() {
- do_query "DELETE FROM mysql.user WHERE User='';"
+ do_query "DELETE FROM mysql.global_priv WHERE User='';"
if [ $? -eq 0 ]; then
echo " ... Success!"
else
@@ -336,7 +336,7 @@ remove_anonymous_users() {
}
remove_remote_root() {
- do_query "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
+ do_query "DELETE FROM mysql.global_priv WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
if [ $? -eq 0 ]; then
echo " ... Success!"
else