Postgres No permission to create user

前端 未结 2 785
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 04:16

I am unable to use rails with postgres. The database wont create:

sayth@sayth-TravelMate-5740G:~/testapp2$ rake db:create:all
PG::InsufficientPrivilege: ERROR:           


        
相关标签:
2条回答
  • 2021-02-06 04:50

    Add this using during gitlab_ci DB setup. I solve the problem as described by @Audrius Meškauskas on Ubuntu 12.04:

    Connect as Admin

    sudo -u postgres psql -d template1
    

    Alter role

    ALTER ROLE gitlab_ci WITH CREATEDB;
    

    Re-run the task

    sudo -u gitlab_ci -H bundle exec rake db:setup RAILS_ENV=production
    
    0 讨论(0)
  • 2021-02-06 04:51

    The username / password you use lack the administrator rights that are necessary for creation users and databases.

    Login as administrator and fix the permissions. If you have administrator login credentials, login and use ALTER ROLE to fix the rights on that account.

    0 讨论(0)
提交回复
热议问题