I typed psql
and I get this:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
con
My issue with this error message was in wrong permissions on key and pem certificates, which I have manipulated. What helped me a lot was: /var/log/postgresql/postgresql-9.5-main.log where are all the errors.
So for me and my pals working on a Node.js app (with Postgres and Sequelize), we had to
brew install postgresql
(one of us was missing postgres, one of us was not, and yet we were getting the same error msg as listed above)
brew services start postgresql
**** (utilize Homebrew to start postgres)
createdb <name of database in config.json file>
node_modules/.bin/sequelize db:migrate
npm start
I was facing same problem and
sudo su - postgres
initdb --locale en_US.UTF-8 -D /var/lib/postgres/data
exit
sudo systemctl start postgresql
sudo systemctl status postgresql
This worked for me.
Solved it! Although I don't know what happened, but I just deleted all the stuff and reinstalled it. This is the command I used to delete it sudo apt-get --purge remove postgresql\*
and dpkg -l | grep postgres
. The latter one is to find all the packets in case it is not clean.
I resolved this problem by checking my file system the disk was completely full, and so database could not start up
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432" ?
I tried series of troubleshooting, until when i checked my disk usage and found that it was full, 100% usage,
df -h
cd /var/log/odoo/
cat /dev/null > odoo-server.log
reboot
Restarting the instance worked for me. Also, as mentioned in some other post psql -h '/tmp' worked as well before the restart. But post restart psql directly started working. So, probably some file ownership issues that got reset with the restart is what I am thinking.