Here is the problem in the Rakefile generated by rails (line 92),
shouldn''t that establish_connection use the test configuration?
desc "Drop the test database and bring it back again"
task :purge_test_database do
if database_configurations["test"]["adapter"] ==
"mysql"
ActiveRecord::Base.establish_connection(database_configurations["production"])
ActiveRecord::Base.connection.recreate_database(database_configurations["test"]["database"])
Sean Leach wrote:> Using latest Rails (0.8.5) I have the following config/database.yml
>
> production:
> adapter: mysql
> database: db_production
> host: localhost
> username: user_production
> password: password
> test:
> adapter: mysql
> database: db_test
> host: localhost
> username: user_test
> password: password
>
>
> When I run ''rake clone_production_structure_to_test'' in
my project
> directory, I get:
> % rake clone_production_structure_to_test
> rake aborted!
> Access denied for user
''user_production''@''localhost'' to database
> ''db_test'': DROP DATABASE IF EXISTS db_test
> ./Rakefile:96
>
> Why is it trying to use my production user to run tests against the test
> database? In the examples I see them using the ''root''
user, which won''t
> cause permissions errors, but I would prefer not to do that. Do I need
> to grant access to my test database to my production user? That would be
> silly.
>
> Thanks!
> Sean
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails