Permalink
Browse files

Use the rails user when creating and dropping the database rather tha…

…n falling back to the currently logged in user who may or may not have CREATE / DROP privileges and no password.

Closes #11564 (trac)
  • Loading branch information...
1 parent 6ef4239 commit f386676661068573d2b58f6bd7a7245b4ff5ce5d @ssoroka ssoroka committed with NZKoz Apr 21, 2008
Showing with 6 additions and 6 deletions.
  1. +6 −6 activerecord/Rakefile
View
@@ -19,6 +19,8 @@ RELEASE_NAME = "REL #{PKG_VERSION}"
RUBY_FORGE_PROJECT = "activerecord"
RUBY_FORGE_USER = "webster132"
+MYSQL_DB_USER = 'rails'
+
PKG_FILES = FileList[
"lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "[A-Z]*", "install.rb", "Rakefile"
].exclude(/\bCVS\b|~$/)
@@ -46,16 +48,14 @@ end
namespace :mysql do
desc 'Build the MySQL test databases'
task :build_databases do
- %x( mysqladmin create activerecord_unittest )
- %x( mysqladmin create activerecord_unittest2 )
- %x( mysql -e "grant all on activerecord_unittest.* to rails@localhost" )
- %x( mysql -e "grant all on activerecord_unittest2.* to rails@localhost" )
+ %x( mysqladmin --user=#{MYSQL_DB_USER} create activerecord_unittest )
+ %x( mysqladmin --user=#{MYSQL_DB_USER} create activerecord_unittest2 )
end
desc 'Drop the MySQL test databases'
task :drop_databases do
- %x( mysqladmin -f drop activerecord_unittest )
- %x( mysqladmin -f drop activerecord_unittest2 )
+ %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest )
+ %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest2 )
end
desc 'Rebuild the MySQL test databases'

0 comments on commit f386676

Please sign in to comment.