Browse files

Delete anonymous MySQL user when bootstrapping the db. Fixes #185

  • Loading branch information...
1 parent 7419705 commit ce84ff2f02bf5533e1c6bb14b15f674cbc93f9ae @willkoehler willkoehler committed Aug 24, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 templates/mysql/config/rubber/deploy-mysql.rb
1 templates/mysql/config/rubber/deploy-mysql.rb
@@ -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};"

0 comments on commit ce84ff2

Please sign in to comment.