Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

could not connect to server: Connection refused Is the server running on host and accepting TCP/IP connections on port 5432?

cd /etc/postgresql/9.x/main/
------- open file named postgresql.conf
sudo nano postgresql.conf
------- add this line to that file
listen_addresses = '*'
------- then open file named pg_hba.conf
sudo nano pg_hba.conf
------- and add this line to that file
host  all  all 0.0.0.0/0 md5
------- restart your server
sudo /etc/init.d/postgresql restart
Comment

could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432

// In my case PostgreSQL updates from version 13.4 to 14 in background, so it fixes by:
	brew postgresql-upgrade-database
// In other case the problem fixed by:
	rm -rf /usr/local/var/postgres/postmaster.pid
// Restart service postgresql:
	brew services restart postgresql
// How can you understand what is the problem?
// For first see what service is not correct started:
	brew services list
// For second show file postgres.log, where will be the error:
	tail -f /usr/local/var/log/postgres.log
// And so find answer by this error's text
Comment

connection to server at "localhost" (::1), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections

FATAL:  lock file "postmaster.pid" already exists
 HINT:   Is another postmaster (PID 379) running in data directory "/usr/local/var/postgres"?
Comment

PREVIOUS NEXT
Code Example
Shell :: react native gitignore 
Shell :: Remove uninstall Java in CentOS 
Shell :: ubuntu kill process 
Shell :: how to upload laravel project on github using command 
Shell :: uninstall package ubuntu 
Shell :: What should you run to modify your last commit? 
Shell :: awk trim every nth line 
Shell :: ubuntu 20.04 uninstall all games 
Shell :: bash: tree: command not found... centos7 
Shell :: install live-server via npm 
Shell :: sum of array elements bash 
Shell :: how to copy ssh key 
Shell :: remove docker created network 
Shell :: ubuntu mouse mover 
Shell :: install zsh with powerlevel10k customization addon 
Shell :: debuild: command not found 
Shell :: list 
Shell :: chmod for pem file 
Shell :: how to exit telnet linux 
Shell :: speedtest linux cli 
Shell :: sqlmap POST request injection 
Shell :: how to install ansible in centos 
Shell :: set trustedinstaller as owner 
Shell :: pm2 start yarn start 
Shell :: npm install custom registry 
Shell :: bash or 
Shell :: install openvpn access server on ubuntu 
Shell :: install chrome ubuntu automatic update 
Shell :: choco upgrade 
Shell :: snap-update-ns failed with code 1 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =