public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
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)
Steven Soroka (author)
Sun Apr 20 21:40:16 -0700 2008
NZKoz (committer)
Sun Apr 20 21:42:15 -0700 2008
commit  f386676661068573d2b58f6bd7a7245b4ff5ce5d
tree    ae34971ad5ea09f544664edc2e79f6918ddfc0d4
parent  6ef4239f8bd4d4ea7a5bc7f2cdaf14f87e6eb9a1
...
19
20
21
 
 
22
23
24
...
46
47
48
49
50
51
52
 
 
53
54
55
56
57
58
 
 
59
60
61
...
19
20
21
22
23
24
25
26
...
48
49
50
 
 
 
 
51
52
53
54
55
56
 
 
57
58
59
60
61
0
@@ -19,6 +19,8 @@ RELEASE_NAME  = "REL #{PKG_VERSION}"
0
 RUBY_FORGE_PROJECT = "activerecord"
0
 RUBY_FORGE_USER    = "webster132"
0
 
0
+MYSQL_DB_USER = 'rails'
0
+
0
 PKG_FILES = FileList[
0
     "lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "[A-Z]*", "install.rb", "Rakefile"
0
 ].exclude(/\bCVS\b|~$/)
0
@@ -46,16 +48,14 @@ end
0
 namespace :mysql do
0
   desc 'Build the MySQL test databases'
0
   task :build_databases do
0
-    %x( mysqladmin  create activerecord_unittest )
0
-    %x( mysqladmin  create activerecord_unittest2 )
0
-    %x( mysql -e "grant all on activerecord_unittest.* to rails@localhost" )
0
-    %x( mysql -e "grant all on activerecord_unittest2.* to rails@localhost" )
0
+    %x( mysqladmin --user=#{MYSQL_DB_USER} create activerecord_unittest )
0
+    %x( mysqladmin --user=#{MYSQL_DB_USER} create activerecord_unittest2 )
0
   end
0
 
0
   desc 'Drop the MySQL test databases'
0
   task :drop_databases do
0
-    %x( mysqladmin -f drop activerecord_unittest )
0
-    %x( mysqladmin -f drop activerecord_unittest2 )
0
+    %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest )
0
+    %x( mysqladmin --user=#{MYSQL_DB_USER} -f drop activerecord_unittest2 )
0
   end
0
 
0
   desc 'Rebuild the MySQL test databases'

Comments