Newbie: problem Connecting to Server

Started by Ferindo Middleton Jrabout 23 years ago8 messagesgeneral
Jump to latest
#1Ferindo Middleton Jr
ferindo.middleton@verizon.net

I'm running Redhat Linux 8. I have registration to the Redhat Network so
I'm probably running the latest version of postgre sql available. I also
have Redhat Databse v2.1 installed, but whenever I try to start a session,
I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect and begin to use
postgresql.

#2No Longer Frustrated
nowweare@access4cheap.com
In reply to: Ferindo Middleton Jr (#1)
Re: Newbie: problem Connecting to Server

I am having this exact same problem. Any help would be greatly appreciated.
Thank you.

"Ferindo Middleton Jr" <ferindo.middleton@verizon.net> wrote in message
news:pan.2003.03.31.01.23.34.434512@verizon.net...

Show quoted text

I'm running Redhat Linux 8. I have registration to the Redhat Network so
I'm probably running the latest version of postgre sql available. I also
have Redhat Databse v2.1 installed, but whenever I try to start a session,
I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect and begin to use
postgresql.

#3Marc Drouin
marc.drouin@fondex.ca
In reply to: No Longer Frustrated (#2)
Re: Newbie: problem Connecting to Server

I sorta had the same problem using pgAccess. The way to correct my problem
was to start the postmaster using the TCP/IP options.

I now use the following to start postmaster:

pg_ctl start -D /path to data -o -i

the -i option enables 'listening' on TCP ports.

From a beginner to a beginner

Marc

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Ferindo
Middleton Jr
Sent: Sunday, March 30, 2003 8:22 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Newbie: problem Connecting to Server

I'm running Redhat Linux 8. I have registration to the Redhat Network so
I'm probably running the latest version of postgre sql available. I also
have Redhat Databse v2.1 installed, but whenever I try to start a session,
I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect and begin to use
postgresql.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

#4alex b.
mailinglists1@gmx.de
In reply to: No Longer Frustrated (#2)
Re: Newbie: problem Connecting to Server

Frustrated Beginner wrote:

I am having this exact same problem. Any help would be greatly appreciated.
Thank you.

"Ferindo Middleton Jr" <ferindo.middleton@verizon.net> wrote in message
news:pan.2003.03.31.01.23.34.434512@verizon.net...

I'm running Redhat Linux 8. I have registration to the Redhat Network so
I'm probably running the latest version of postgre sql available. I also
have Redhat Databse v2.1 installed, but whenever I try to start a session,
I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect and begin to use
postgresql.

you guys first have to create a POSTGRESQL USER, under which the
server will run...

in other words: the server (postmaster) must be running, which it is
not, apparently.

/tmp/.s.PGSQL.5432
is a unix socket, to which the client connects. the postgresql-server
creates that socket itself.
since you guys are running redhat, you should be able to set the scripts
to started at boot time in different runlevels (runlevel editor) and
select postgresql to be started... as root as a matter of course.

if none of that works, then try the following as root:

first uninstall the postgresql, download the kernelheaders to your
current kernel, download the current postgresql-sources (7.3.2), compile
that, and install (make install - as root)

follow these directions (all as root):
- create the user "postgres" belonging to group "daemon"
- mkdir /usr/local/pgsql/logs
- mkdir /usr/local/pgsql/data
- chmod 700 /usr/local/pgsql/data
- echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf
- ldconfig
- chown -R postgres:daemon /usr/local/pgsql
- su postgres -c '/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data'
- su postgres -c '/usr/local/pgsql/bin/postmaster -D
/usr/local/pgsql/data >> /usr/local/pgsql/logs/server.log 2>&1' &
(all in one line)

and you're done, you may now create a new and fresh database, just like
this:

- su postgres -c '/usr/local/pgsql/bin/createdb <databasename>'

notice that "su postgres .." command... it is because postmaster (the
server binary) likes to be started as a user and not as root, since that
would be a dangerous act. all programs can be exploited and evil, evil
badboys could gain root privileges and destroy the whole world...
postgresql simply won't start as root - security issues.

ANYONE: please correct me, if I'm wrong!!!!! it is important, so I or
them won't mess up their systems..

cheers,
alex

#5Tamir Halperin
tamir@brobus.net
In reply to: alex b. (#4)
Re: Newbie: problem Connecting to Server

Looks like no one has corrected you, alex, so, as it pertains to redhat, a user of which I am not, you may have directed Frustrated correctly.

I just wanted to add to the comment below about "option -i" that the postgresql.conf file has a setting in it, "tcpip_socket" which can be set to the value true after being uncommented. That way you won't have to specify the option if you restart the PostgreSQL manually.

Show quoted text

-----Original Message-----
From: alex b. [mailto:mailinglists1@gmx.de]
Sent: Thursday, April 03, 2003 3:42 PM
To: Frustrated Beginner
Cc: Postgresql General; Jonas Hoge
Subject: Re: [GENERAL] Newbie: problem Connecting to Server

Frustrated Beginner wrote:

I am having this exact same problem. Any help would be

greatly appreciated.

Thank you.

"Ferindo Middleton Jr" <ferindo.middleton@verizon.net>

wrote in message

news:pan.2003.03.31.01.23.34.434512@verizon.net...

I'm running Redhat Linux 8. I have registration to the

Redhat Network so

I'm probably running the latest version of postgre sql

available. I also

have Redhat Databse v2.1 installed, but whenever I try to

start a session,

I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect

and begin to use

postgresql.

you guys first have to create a POSTGRESQL USER, under which the
server will run...

in other words: the server (postmaster) must be running, which it is
not, apparently.

/tmp/.s.PGSQL.5432
is a unix socket, to which the client connects. the postgresql-server
creates that socket itself.
since you guys are running redhat, you should be able to set
the scripts
to started at boot time in different runlevels (runlevel editor) and
select postgresql to be started... as root as a matter of course.

if none of that works, then try the following as root:

first uninstall the postgresql, download the kernelheaders to your
current kernel, download the current postgresql-sources
(7.3.2), compile
that, and install (make install - as root)

follow these directions (all as root):
- create the user "postgres" belonging to group "daemon"
- mkdir /usr/local/pgsql/logs
- mkdir /usr/local/pgsql/data
- chmod 700 /usr/local/pgsql/data
- echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf
- ldconfig
- chown -R postgres:daemon /usr/local/pgsql
- su postgres -c '/usr/local/pgsql/bin/initdb -D
/usr/local/pgsql/data'
- su postgres -c '/usr/local/pgsql/bin/postmaster -D
/usr/local/pgsql/data >> /usr/local/pgsql/logs/server.log 2>&1' &
(all in one line)

and you're done, you may now create a new and fresh database,
just like
this:

- su postgres -c '/usr/local/pgsql/bin/createdb <databasename>'

notice that "su postgres .." command... it is because postmaster (the
server binary) likes to be started as a user and not as root,
since that
would be a dangerous act. all programs can be exploited and
evil, evil
badboys could gain root privileges and destroy the whole world...
postgresql simply won't start as root - security issues.

ANYONE: please correct me, if I'm wrong!!!!! it is important, so I or
them won't mess up their systems..

cheers,
alex

---------------------------(end of
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#6Lamar Owen
lamar.owen@wgcr.org
In reply to: Tamir Halperin (#5)
Re: Newbie: problem Connecting to Server

On Thursday 03 April 2003 23:12, Tamir Halperin wrote:

Looks like no one has corrected you, alex, so, as it pertains to redhat, a
user of which I am not, you may have directed Frustrated correctly.

you guys first have to create a POSTGRESQL USER, under which the
server will run...

ANYONE: please correct me, if I'm wrong!!!!! it is important, so I or
them won't mess up their systems..

Somehow I missed this the first time around....

With an RPM install of PostgreSQL (which RedHat Database is), please consult
README.rpm-dist (find it with 'rpm -ql postgresql |grep rpm').

The short of it:
The RPM install scripts handle the user creation. All one must do is (as
root): '/sbin/service postgresql start' to get an initdb done and postmaster
started. Then edit /var/lib/pgsql/data/pg_hba.conf to allow access to the
client IP address, and edit postgresql.conf (in the same directory) for
tcpip_socket to be true (if you are doing TCP/IP connections, that is).

To get postgresql started automatically at boot, do (assuming you want
postgresql to run in runlevels 3, 4, and 5): '/sbin/chkconfig --level 345
postgresql on'

List the currently valid runlevels with '/sbin/chkconfig --list postgresql'

If it complains about postgresql not be a known service, execute
'/sbin/chkconfig --add postgresql' -- if that doesn't work, check to see if
the postgresql-server RPM is installed ('rpm -qa|grep postgresql').
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

#7codeWarrior
GPatnude@adelphia.net
In reply to: Ferindo Middleton Jr (#1)
Re: Newbie: problem Connecting to Server

Is postgreSQL even running ????

# ps ax | grep postgres

"Ferindo Middleton Jr" <ferindo.middleton@verizon.net> wrote in message
news:pan.2003.03.31.01.23.34.434512@verizon.net...

Show quoted text

I'm running Redhat Linux 8. I have registration to the Redhat Network so
I'm probably running the latest version of postgre sql available. I also
have Redhat Databse v2.1 installed, but whenever I try to start a session,
I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect and begin to use
postgresql.

#8No Longer Frustrated
nowweare@access4cheap.com
In reply to: Ferindo Middleton Jr (#1)
Re: Newbie: problem Connecting to Server

So others might learn from this. The following solution was offered and
helped considerably in my case:

With an RPM install of PostgreSQL (which RedHat Database is), please consult

README.rpm-dist (find it with 'rpm -ql postgresql |grep rpm').

The short of it:

The RPM install scripts handle the user creation. All one must do is (as

root): '/sbin/service postgresql start' to get an initdb done and postmaster

started. Then edit /var/lib/pgsql/data/pg_hba.conf to allow access to the

client IP address, and edit postgresql.conf (in the same directory) for

tcpip_socket to be true (if you are doing TCP/IP connections, that is).

To get postgresql started automatically at boot, do (assuming you want

postgresql to run in runlevels 3, 4, and 5): '/sbin/chkconfig --level 345

postgresql on'

List the currently valid runlevels with '/sbin/chkconfig --list postgresql'

If it complains about postgresql not be a known service, execute

'/sbin/chkconfig --add postgresql' -- if that doesn't work, check to see if

the postgresql-server RPM is installed ('rpm -qa|grep postgresql').

-No Longer Frustrated

"Frustrated Beginner" <nowweare@access4cheap.com> wrote in message
news:3e8b9c82_1@newsfeed...

I am having this exact same problem. Any help would be greatly

appreciated.

Thank you.

"Ferindo Middleton Jr" <ferindo.middleton@verizon.net> wrote in message
news:pan.2003.03.31.01.23.34.434512@verizon.net...

I'm running Redhat Linux 8. I have registration to the Redhat Network so
I'm probably running the latest version of postgre sql available. I also
have Redhat Databse v2.1 installed, but whenever I try to start a

session,

I get the following error message:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Please help me configure my system so that I can connect and begin to

use

Show quoted text

postgresql.