postgresql could not connect to server [closed] - postgresql

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've been trying to set up a VPS mainly for testing purposes, but I've lost so many hours now on this seemingly stupid issue that the only thing I can to is turn to the community's shared knowledge to try to solve it.
Scenario: Fresh VPS Ubuntu (Ubunut now) 12.04 install. Updated and upgraded.
First thing I do is to create a new user with sudo capabilities, login with such user and start working.
I input the commands:
sudo apt-get install postgresql
sudo su - postgres
psql -d postgres -U postgres
and now I get
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"?
I am not a Linux wizard, but I've got a good experience in setting up a Rails/PG environment, I did it so many times on local machines, and a few times on VPS machines too.
Now, I just can't get what the hell is going on.
Any suggestion?

Related

Configure Apache Age with pgAdmin [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 days ago.
This post was edited and submitted for review 2 days ago and failed to reopen the post:
Needs more focus Update the question so it focuses on one problem only by editing this post.
Improve this question
I've been looking for ways to configure apache-age with pgAdmin for easier interaction between PostgreSQL and Apache age on Windows.
I could not find anything related to set up with pgAdmin in the docs.
https://age.apache.org/age-manual/master/intro/setup.html
Can someone please guide me on how to set up apache age with pgAdmin?
You actually just need to connect the running postgres server instance with pgadmin.
Start the server bin/pg_ctl -D /data start
Open pgadmin and connect to the server by giving some details about the runing instance.
Go to pgadmin->servers(right-click)->register->server. Give the server details.
port: 5432 (default)
hostname/address:"localhost"
username: postgres
password: postgres
Here is Youtube Link for Installation in Windows. First, try to install Postgres and Apache AGE using this video tutorial.
To connect to Apache-age using pgAdmin, open pgAdmin and create a new server connection. In the New Server Registration dialog, enter the following information:
Name: A name for the connection.
Host: The hostname or IP address of the machine running Apache-age.
Port: The port number configured in the apache-age.conf file.
Database: the name of the database that you want to connect to. This should be a PostgreSQL database that you wish to use with Apache-age.
Click Save to establish the connection after entering this data. Now, you should be able to use pgAdmin to communicate with PostgreSQL via Apache-age.

How to create this file "/var/run/postgresql/.s.PGSQL.5432"? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
By mistake, I deleted the .s.PGSQL.5432 file in folder /var/run/postgresql
because of that , I cant able to add server in pgAdmin , Instead i am getting error like below
An error has occurred:
Error connecting to the server: 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"?
please, someone help me to resolve this problem
A simple fix would be to restart the PostgreSQL daemon. It should recreate the socket file on startup.
Reloading the configuration file might also cause the socket file to be recreated. You can do this from a shell:
pg_ctl reload
Or from an existing PostgreSQL connection that has superuser privileges:
SELECT pg_reload_conf();

Can't connect to another PC on the same network on a particular port [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to access the postgresql service which is running on my computer (which as you can see in the picture, it is running), from another computer on the same network.
On another computer, I am trying to access port 5432 (on which this service runs) by typing in telnet 192.168.2.102 5432; however it fails to connect. Can someone tell me what the problem might be please?
Read this and this pages of the manual to set up connections to the postgresql server correctly.
Take a closer look at listen_addresses, port configuration in postgresql.conf and security settings in pg_hba.conf.
And dont forget to restart your server after you've updated the config files.

Open Port 3306 via SSH [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to access a Remote MySQL database from a GoDaddy VPS. I have enabled remote access on my server but I need to open the 3306 port on GoDaddy's VPS. I was told by their suppor I would need to do this via SSH but they were not able to help me any further than that. I have successfully connected to my server via SSH. I have run the following command:
telnet myserver.com 3306
When I rund that command I get the following message, SHost is not allowed to connect to this MySQL serverConnection closed by foreign host.
How do I open the port to allow me to connect to a Remote MySQL database?
Use port forwarding.
ssh -L 3306:localhost:3306 myserver.com
(I assume you normally ssh to your server by running ssh myserver.com.)
Then, while that connection is active, connect to the database on localhost instead of myserver.com (e.g. test using telnet localhost 3306).
More details in the ssh manual.

Remote connection to PostgreSQL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have just installed Postgresql 9.1 on windows server 2008. I was trying to connect it from the remote computer on the default port 5432(as I have not changed it), but was not successful. So what are the possible configuration settings changes to made?
You need to update some configuration files. They will be in a sub directory of your postgresql install in the data directory. On Windows most likely C:\Program Files\PostgreSQL\9.1\data
You need to update your postgres.conf file to listen_addresses = '*' so the postgres service can be seen by other machines. See 18.3. Connections and Authentication.
To let any machine connect to postgres pg_hba.conf. The 0.0.0.0/0 says let any ip address connect. You can trim this down so it's only ip ranges on your network. See 19.1. The pg_hba.conf File.
all all 0.0.0.0/0 md5
You should check your Postgresql Configuration file.
Verify the setting for listen_addresses. By default it likely only listens on your loopback address which would not allow you to connect from another machine. The simplest way to get it listening on an external interface is to set it to: listen_addresses = '*'
More info can be found in the documentation here.