<% grant_locations.each do |location| %> GRANT <%= grant %> ON <%= db_name %>.* TO '<%= db_user %>'@'<%= location %>' IDENTIFIED BY '<%= db_pass %>'; <% end %> CREATE DATABASE IF NOT EXISTS <%= db_name %>; FLUSH PRIVILEGES;