You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mysql([defaults_file,'-e',"GRANT USAGE ON *.* TO '#{merged_name}' IDENTIFIED BY PASSWORD '#{password_hash}' WITH MAX_USER_CONNECTIONS #{max_user_connections} MAX_CONNECTIONS_PER_HOUR #{max_connections_per_hour} MAX_QUERIES_PER_HOUR #{max_queries_per_hour} MAX_UPDATES_PER_HOUR #{max_updates_per_hour}"].compact)
50
-
51
-
@property_hash[:ensure]=:present
52
-
@property_hash[:password_hash]=password_hash
51
+
# Use CREATE USER to be compatible with NO_AUTO_CREATE_USER sql_mode
52
+
# This is also required if you want to specify a authentication plugin
53
+
if !plugin.nil?
54
+
mysql([defaults_file,'-e',"CREATE USER '#{merged_name}' IDENTIFIED WITH '#{plugin}'"].compact)
55
+
@property_hash[:ensure]=:present
56
+
@property_hash[:plugin]=plugin
57
+
else
58
+
mysql([defaults_file,'-e',"CREATE USER '#{merged_name}' IDENTIFIED BY PASSWORD '#{password_hash}'"].compact)
59
+
@property_hash[:ensure]=:present
60
+
@property_hash[:password_hash]=password_hash
61
+
end
62
+
mysql([defaults_file,'-e',"GRANT USAGE ON *.* TO '#{merged_name}' WITH MAX_USER_CONNECTIONS #{max_user_connections} MAX_CONNECTIONS_PER_HOUR #{max_connections_per_hour} MAX_QUERIES_PER_HOUR #{max_queries_per_hour} MAX_UPDATES_PER_HOUR #{max_updates_per_hour}"].compact)
provider.expects(:mysql).with([defaults_file,'-e',"GRANT USAGE ON *.* TO 'joe'@'localhost' IDENTIFIED BY PASSWORD '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4' WITH MAX_USER_CONNECTIONS 10 MAX_CONNECTIONS_PER_HOUR 10 MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 10"])
66
+
provider.expects(:mysql).with([defaults_file,'-e',"CREATE USER 'joe'@'localhost' IDENTIFIED BY PASSWORD '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4'"])
67
+
provider.expects(:mysql).with([defaults_file,'-e',"GRANT USAGE ON *.* TO 'joe'@'localhost' WITH MAX_USER_CONNECTIONS 10 MAX_CONNECTIONS_PER_HOUR 10 MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 10"])
0 commit comments