I have installed postgresql 9.5.13, but it seems not to work. I get continiosly this message:
createuser: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
when i try to create user. I have seen that this is common problem, but i can't find solution for this.
See if the service is running
systemctl status postgresql
If PostgreSQL is running, you'll see output that includes the text Active: active (exited).
If you see Active: inactive (dead), start the PostgreSQL service using the following command:
systemctl start postgresql
PostgreSQL also needs to be enabled to start on reboot. Do that with this command:
systemctl enable postgresql
Run
pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
9.5 main 5433 online postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log
Status - online - fine
Start the server using the default database path by typing this :
sudo -i -u postgres
/usr/lib/postgresql/9.5/bin/pg_ctl -D /var/lib/postgresql/9.5/main/ -l logfile start
than try:
psql
Done !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With