not able to launch psql console - psql

New to psql getting the error while giving first command psql after installation. I checked all ports required are free and i changed service to "run" state ,still not working
FULL ERROR:
psql: could not connect to server:connection refused
<0x0000274D/10061>
Is the server runnining on "localhost"<::1> and
accepting
TCP/IP connections omn port 5432?
could not connect to server:connectionrefused<0x0000274D/10061>
is the server running on host "localhost"<127.0.0.1> and accepting TCP/Ip connections on port 5432?

Related

pgadmin4 : Unable to connect to local server

I've installed a dpage/pgadmin4(port:5050) on my vmware centos8 from Docker.
And my database postgis(version:11.2-1,port:5432) also run on docker.
Now I can connect my postgis by using navicat but pdadmin4 not works.
I've got this:
Unable to connect to server:
could not connect to server: Permission denied Is the server running on host "172.17.0.1" and accepting TCP/IP connections on port 5432?
or:
Unable to connect to server:
could not connect to server: Permission denied Is the server running on host "xxxx.xxxx.xxx.xxxx"(centos ip) and accepting TCP/IP connections on port 5432?
I tried ways from stackoverflow but not work.

Rails db:create using PostgreSQL return PG::ConnectionBad: could not connect to server: Connection refused

I was following the tutorial to develop using react and rails from the DigitalOcean Tutorial.
I have done
rails new rails_react_recipe -d=postgresql -T --webpack=react --skip-coffee
It created the directory with all the necessary tools - ruby and rails.
Then the next step is to create the database
rails db:create
but it returned me the error below
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Couldn't create 'rails_react_recipe_development' database. Please check your configuration.
rails aborted!
PG::ConnectionBad: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:create
(See full trace by running task with --trace)
I have installed postgresql 12 for windows from https://www.postgresql.org/download/
I couldn't find any solution online. Help will be really appreciated. Thanks!
You need to start the Postgres server for it to start accepting connections. Currently, you've probably downloaded Postgres, but not started it.
You could follow instructions here to learn how to start it on Windows: https://tableplus.com/blog/2018/10/how-to-start-stop-restart-postgresql-server.html

connection error to redshift within Apache Airflow

I have installed Apache Airflow on Centos VMware, I have created a connection through Airflow UI to Redshift
Admin --> connections
When i run the adhoc query through Data profiling , i get the below error.
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
Kindly let me know how to fix this.
The error message says Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? which seems to indicate that you are trying to connect to Redshift running at localhost:5432, which is unlikely.
Though port 5432 is usually for postgres?
Maybe double check that you've configured your Redshift/postgres connection correctly?

pg_dump: [archiver (db)] connection to database "development" failed: could not connect to server: Connection refused

In trying to push my database from my development.sqlite3 file to my Heroku app, I encountered the following error message:
pg_dump: [archiver (db)] connection to database "development" failed: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
pg_restore: [archiver] input file is too short (read 0, expected 5)
psql: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
I am new to Heroku and can't figure this one out. Hoping it's something simple I'm overlooking.
First off, sqlite isn't intended to be used in production. In fact, Heroku doesn't support using sqlite, so you'll need to switch to Postgres if you want to use your app with Heroku: https://devcenter.heroku.com/articles/getting-started-with-rails4#write-your-app.
The specific error you're getting is because your heroku app is to connect to port 5432, which is utilized by Postgres by default and is not used by sqlite. However, since you don't have a PG server to connect to on localhost, you app is failing with that error.

Unable to restart Postgres Server

For my rails application, every time I try to do rails console, I get this error:
server: Connection refused (PG::ConnectionBad)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
I suspected that this was because my postgres server was down.. So I used the lunchy gem to stop and start my server. However, I still keep getting the same error.
lunchy stop postgres
lunchy start postgres
I also tried this:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
and got server starting
but when I do this: pg_ctl -D /usr/local/var/postgres status, it does not work because I get a pg_ctl: no server running
Why is this the case?

Resources