Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.45 KB

postgresql.md

File metadata and controls

59 lines (41 loc) · 1.45 KB

ERROR

  • DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

  • postgresql: Invalid data directory | Can't open PID file /var/run/postgresql/10-main.pid (yet?) after start: No such file or directory

  • Phoenix: mix ecto.create fails

Solution :

Try this:

pg_lsclusters
  • If you have this response:
Ver Cluster Port Status Owner Data directory Log file
10 main 5432 down postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
  • Change access permissions to /var/lib/postgresql/10/main
sudo chmod 700 -R /var/lib/postgresql/10/main
  • Restart
sudo -i -u postgres
/usr/lib/postgresql/10/bin/pg_ctl restart -D /var/lib/postgresql/10/main
  • Then, check it
Ver Cluster Port Status Owner Data directory Log file
10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
Ref Link - Link

ERROR

  • panic: pq: unknown authentication response: 10 go

Solution :

Try this:

sudo -i -u postgres
psql
SET password_encryption = 'scram-sha-256';
ALTER ROLE myuser SET password_encryption = 'scram-sha-256';
ALTER ROLE myuser WITH PASSWORD 'mypassword';
Ref Link - Link