PG rails db:create InsufficientPrivilege。拒绝创建db的权限。

问题描述 投票:0回答:1

我执行了。

$ GRANT ALL PRIVILEGES ON db1 to user1
$ ALTER USER user1 CREATEDB
$ ALTER USER user1 CREATEDB
$ ALTER USER user1 WITH 'pass'

但还是得到一个错误的信息

$ rails db:create

configdatabase.yml。

default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # https://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
  <<: *default
  database: pg_app_development

Linux Manjaro.Rails 6.0.2.2Ruby 2.7.1Pg 12.2

另外,我不想把超级用户信息放在数据库.yml中。

ruby-on-rails database access pg manjaro
1个回答
0
投票
$ ALTER USER USER1 WITH CREATEDB
© www.soinside.com 2019 - 2024. All rights reserved.