From 61060f4b5f40ba2a8a7e68020e8562539598ae94 Mon Sep 17 00:00:00 2001 From: Wouter Oosterveld Date: Tue, 29 Nov 2016 20:15:17 +0100 Subject: [PATCH] mysql_user: fix user_mod on MySQL(-like) 5.7+ (Fixes #3003) (#5388) --- lib/ansible/modules/database/mysql/mysql_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/database/mysql/mysql_user.py b/lib/ansible/modules/database/mysql/mysql_user.py index 24a5444667..575752ec4f 100644 --- a/lib/ansible/modules/database/mysql/mysql_user.py +++ b/lib/ansible/modules/database/mysql/mysql_user.py @@ -346,7 +346,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted, new_priv, append if old_user_mgmt: cursor.execute("SET PASSWORD FOR %s@%s = %s", (user, host, password)) else: - cursor.execute("ALTER USER %s@%s IDENTIFIED BY %s", (user, host, password)) + cursor.execute("ALTER USER %s@%s IDENTIFIED WITH mysql_native_password BY %s", (user, host, password)) changed = True # Handle privileges