# Use CREATE USER to be compatible with NO_AUTO_CREATE_USER sql_mode
# This is also required if you want to specify a authentication plugin
if!plugin.nil?
ifplugin=='sha256_password'and!password_hash.nil?
mysql([defaults_file,'-e',"CREATE USER '#{merged_name}' IDENTIFIED WITH '#{plugin}' AS '#{password_hash}'"].compact)
else
mysql([defaults_file,'-e',"CREATE USER '#{merged_name}' IDENTIFIED WITH '#{plugin}'"].compact)
end
@property_hash[:ensure]=:present
@property_hash[:plugin]=plugin
else
mysql([defaults_file,'-e',"CREATE USER '#{merged_name}' IDENTIFIED BY PASSWORD '#{password_hash}'"].compact)
@property_hash[:ensure]=:present
@property_hash[:password_hash]=password_hash
end
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)