Role does not exist and unable to create database when using PostgreSQL

后端 未结 3 2086
鱼传尺愫
鱼传尺愫 2020-12-07 07:45

I am using Heroku for my application and it requires PostgreSQL but you can still use SQLite3 for development. Since Heroku strongly advised against having 2 different datab

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 08:27

    PostgreSQL will try to create the database with your account (login) name if a username isn't specified in your config/database.yml. On OS X and Linux you can you see who this is with whoami. Looks like you're using Windows.

    Solution A: Create a PostgreSQL user that matches the one it's looking for. For example

    createuser --superuser some_user
    

    Solution B: Change the DB user by explicitly setting a username as shown in mu's answer.

提交回复
热议问题