Horje
could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432 Code Example
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
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




Shell

Related
sudo apt install ubuntu-desktop ? Code Example sudo apt install ubuntu-desktop ? Code Example
install tailwind in angular Code Example install tailwind in angular Code Example
find linux Code Example find linux Code Example
source command Code Example source command Code Example
git change master branch Code Example git change master branch Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11