Postgresql initial configuration: How to access as the postgres user?

后端 未结 2 1506
半阙折子戏
半阙折子戏 2021-01-27 10:10

After installing postgresql, I tried it out, typing createdb mydb, like it\'s written in the documentation. Then the following error occured:

createdb: could not         


        
相关标签:
2条回答
  • 2021-01-27 10:23

    if the db is owned by user postgres you can do the following

    createdb -U postgres dbname

    since by default postgresql will trust connections from localhost.

    0 讨论(0)
  • 2021-01-27 10:43
    su - postgres
    

    and after you have been logged in:

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