Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rake db:reset 'user does not have CONNECT privilege'

So I'm using Heroku Postgres in my Rails app, but I'm not hosting my app on Heroku itself. I used the Active Record connection details from Heroku in my database.yml, and it looks like this:

development: adapter: postgresql encoding: unicode pool: 5 database: [database] username: [username] password: [password] host: ec2-54-227-243-78.compute-1.amazonaws.com port: 5432 

However, now I'm trying to rake db:migrate my app so the database gets all set up with my models. Running that command doesn't do anything, so I tried rake db:reset and I get this:

Couldn't drop df2cokjfj0k4vu : #<PG::Error: FATAL:  permission denied for database "postgres"                                                                   DETAIL:  User does not have CONNECT privilege.                                                                                                                  

df2cokjfj0k4vu already exists
-- initialize_schema_migrations_table()
-> 1.3997s
-- assume_migrated_upto_version(20130924040351, ["/home/action/braindb/db/migrate"])
-> 0.0882s

Any idea what I'm doing wrong. I'm still pretty new to Rails so sometimes I forget how to get my Postgres database setup properly when migrating hosts.

like image 481
Tom Maxwell Avatar asked Sep 24 '13 04:09

Tom Maxwell


2 Answers

Use heroku pg:reset DATABASE instead as noted in https://devcenter.heroku.com/articles/rake

You cannot drop databases in Heroku with rake db:reset because user has no privileges.

like image 121
luigi7up Avatar answered Sep 19 '22 10:09

luigi7up


You can't drop your PG database on Heroku.

like image 27
Nick Veys Avatar answered Sep 23 '22 10:09

Nick Veys