Issue connecting to database

Issue connecting to database:

[root@ravikumar]# psql -U postgres -d EMSDB
psql: 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”?


1. Try to stop the database

bash-4.2$ ./pg_ctl -D /data/ems/db/ -o -p5342 stop -m fast
pg_ctl: directory “/data/ems/db/” is not a database cluster directory

2. If it gives above error,
i) remove postgres pid or lock files under /tmp
ii) check pg_hba.conf file has correct values

3. Excute the command under postgres_home/bin ./pg_ctl -D /data/aniems/db/ -o -p5342 start

4. If the above step does not work, restart the system


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s