From f386676661068573d2b58f6bd7a7245b4ff5ce5d Mon Sep 17 00:00:00 2001 From: Steven Soroka Date: Mon, 21 Apr 2008 16:40:16 +1200 Subject: Use the rails user when creating and dropping the database rather than falling back to the currently logged in user who may or may not have CREATE / DROP privileges and no password. Closes #11564 (trac) --- activerecord/Rakefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'activerecord/Rakefile') diff --git a/activerecord/Rakefile b/activerecord/Rakefile index b475b27037..50c120107b 100755 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -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' -- cgit v1.2.3