Skip to content

Commit 4e48ee5

Browse files
committed
Fix Issue where user couldnt change plugin
1 parent 29138e0 commit 4e48ee5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/puppet/provider/mysql_user/mysql.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ def plugin=(string)
235235
end
236236
elsif newer_than('mysql' => '5.7.6', 'percona' => '5.7.6', 'mariadb' => '10.2.0')
237237
sql = "ALTER USER #{merged_name} IDENTIFIED WITH '#{string}'"
238-
sql += " AS '#{@resource[:password_hash]}'" if string == 'mysql_native_password'
238+
if string == 'mysql_native_password'
239+
sql += " AS '#{@resource[:password_hash]}'"
240+
elsif string == 'caching_sha2_password'
241+
sql += " AS X'#{password_hash[2..-1]}'"
242+
end
239243
else
240244
# See https://bugs.mysql.com/bug.php?id=67449
241245
sql = "UPDATE mysql.user SET plugin = '#{string}'"

0 commit comments

Comments
 (0)