【发布时间】:2013-12-29 07:43:25
【问题描述】:
每当我键入 heroku pg:push 以获取我在 heroku 上的本地数据库时。我收到权限被拒绝错误。知道如何解决它。
$ heroku pg:push mexico2019 HEROKU_POSTGRESQL_COBALT_URL --app mexican
错误:
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: permission denied for relation actions
pg_dump: The command was: LOCK TABLE public.actions IN ACCESS SHARE MODE
pg_dump: *** aborted because of error
pg_restore: [archiver] input file is too short (read 0, expected 5)
数据库.yml
development:
adapter: postgresql
encoding: unicode
host: localhost
username: ram
password: (password)
database: mexico2019
timeout: 5000
production:
adapter: postgresql
encoding: unicode
host: localhost
username: postgres
password: (password)
database: meximexi_pro
pool: 5
timeout: 5000
更新:
List of relations
Schema | Name | Type | Owner
--------+------------------------------+----------+-------
public | actions | table | ram
public | actions_id_seq | sequence | ram
public | admins | table | ram
我试过了
$ sudo su postgres
postgres=# GRANT ALL PRIVILEGES ON DATABASE mexico2019 TO ram;
GRANT
我刚刚注意到,当我输入错误的密码时,它显示“psql: FATAL: password authentication failed for user "alain"”,不应该是用户 ram 吗?
【问题讨论】:
标签: ruby-on-rails ruby heroku