Skip to content

Commit

Permalink
Delete anonymous MySQL user when bootstrapping the db. Fixes rubber#185
Browse files Browse the repository at this point in the history
  • Loading branch information
willkoehler committed Aug 24, 2012
1 parent 7419705 commit ce84ff2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions templates/mysql/config/rubber/deploy-mysql.rb
Expand Up @@ -40,6 +40,7 @@
pass = "identified by '#{env.db_pass}'" if env.db_pass
rubber.sudo_script "create_master_db", <<-ENDSCRIPT
mysql -u root -e "create database #{env.db_name};"
mysql -u root -e "delete from mysql.user where user='' and host='localhost';"
mysql -u root -e "grant all on *.* to '#{env.db_user}'@'%' #{pass};"
mysql -u root -e "grant select on *.* to '#{env.db_slave_user}'@'%' #{pass};"
mysql -u root -e "grant replication slave on *.* to '#{env.db_replicator_user}'@'%' #{pass};"
Expand Down

0 comments on commit ce84ff2

Please sign in to comment.