简体   繁体   中英

POSTGRESQL: Cannot log in postgresql in debian 9

I am trying to log in my postgresql.After researching I have solved a slew of many issues from a weird python dependency issue to creating sudoers with names and passwords as db to removing and reinstalling postgresql, still i cannot log in as the default user "postgres". A simple error but i cannot find a straight forward answer.

 Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

NOTE:

  1. My first installation,postgresql 11, I changed pg_hba.conf from peer to md5 but refused to login.
  2. I removed postgresql 11 using many commands to purge it out of my system but am shocked anytime i do a locate postgress or locate psql i find a list of postgresql files. The most weird is running * apt-get remove --auto-remove postgresql* and sudo apt --purge remove postgresql -y then running service postgresql start only for it to start,Cannot wrap my head around this after trying several times? i thought it would be removed completely.!.
  3. Though I can locate pg_hba.conf , the actual file is totally nonexitent when I ls the containing directory,?! Are there many /etc/ folders, seems am looking at the wrong /etc/ ?

I also faced this problem - You try this method, it's work for me.

If You using Linux then do according your server path .

Window Path ->

Go To -> C:\Program Files\PostgreSQL\11\data then Open pg_hba.conf

Find and replace md5 or sha256 to trust

local   replication     all    trust (Change md5 or sha256 to trust)
host    replication     all    trust (Change md5 or sha256 to trust)

Maybe this method helpful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM