psql: FATAL: Peer authentication failed for user “dev”

后端 未结 12 852
盖世英雄少女心
盖世英雄少女心 2020-12-12 09:40

when i create a new user, but it cannot login the database.
I do that like this:

postgres@Aspire:/home/XXX$ createuser dev
Shall the new role be a superu         


        
12条回答
  •  被撕碎了的回忆
    2020-12-12 10:20

    For people in the future seeing this, postgres is in the /usr/lib/postgresql/10/bin on my Ubuntu server.

    I added it to the PATH in my .bashrc file, and add this line at the end

    PATH=$PATH:/usr/lib/postgresql/10/bin
    

    then on the command line

    $> source ./.bashrc
    

    I refreshed my bash environment. Now I can use postgres -D /wherever from any directory

提交回复
热议问题