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 :: how to uninstall software from ubuntu 
Shell :: install scikit learn 
Shell :: how to copy file in root directory 
Shell :: how to get deployment token from firebase 
Shell :: how to set meld as git difftool 
Shell :: pip upgrade package 
Shell :: git update gitignore remove files 
Shell :: Could not find an NgModule. Use the skip-import option to skip importing in NgModule. 
Shell :: how to revert to last git commit 
Shell :: git revert one file 
Shell :: ailure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user] 
Shell :: Install pgAdmin for desktop mode 
Shell :: brew upgrade all casks 
Shell :: export display connection for wsl 
Shell :: git exclude some files from git commit 
Shell :: remove docker machine 
Shell :: adobe reader linux 
Shell :: macos make file executable 
Shell :: git delete branch upstream 
Shell :: bash for loop parallel 
Shell :: electron app any website 
Shell :: pgadmin4 on docker 
Shell :: uninstall all extensions vscode 
Shell :: Flutter doctor error - Android sdkmanager tool not found. Windows 
Shell :: ionic capacitor android 
Shell :: sample bash script 
Shell :: powershell export-excel 
Shell :: yarn remove package 
Shell :: npm cors api use 
Shell :: conda create tensorflow-gpu environment 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =