0

I receive the following error when I try to start postgresql aka psql in Slackware Linux:

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

I am trying to start it and changed the field in pg_hba.conf to trust from md5.

At some point it was asking for a password.

I get the following when I try to start the server:


bash-5.1# postgres -D /pgsql/data
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.
bash-5.1# postgres -D /pgsql/data >logfile 2>&1 &
[1] 8310

naarter
  • 21
  • 5
  • Does this answer your question? [Postgres could not connect to server](https://stackoverflow.com/questions/13410686/postgres-could-not-connect-to-server) – Sanjay Prajapat Mar 25 '22 at 14:39
  • 1
    1) `psql` is the Postgres client program not the server 2) What you show is not starting the server but trying to connect to it. Is the server running on port 5432? Look at `port` setting in `postgresql.conf`. 3) How did you actually start the server, what script? – Adrian Klaver Mar 25 '22 at 14:42
  • I am not using mac 0s – naarter Mar 25 '22 at 14:44
  • I un commented port 5432 in the conf file. I never started the server. It has been days. – naarter Mar 25 '22 at 15:06
  • The error message explains it you cannot start the server as `root`. You should be starting it via the rc scripts. – Adrian Klaver Mar 25 '22 at 15:14
  • OKay, so how do I do that. Like I am so new to this it is not even funny. I never worked with Linx, Unix, SQL or computers before this. Please understand that you are talking to what could be compared as a moron when compared to you. – naarter Mar 25 '22 at 15:17
  • In that case, you should read the documentation or attend a course. It is hard to give an answer if you don't even know enough to include the relevant information, like what you did to the file or what is in the file. The error message is pretty clear: don't try to start PostgreSQL as user `root`. It will refuse to start. – Laurenz Albe Mar 25 '22 at 15:39
  • 1) If this is your foray into Linux Slackware is not your best choice. It is not a bad distribution it is just old school and requires a good bit of manual intervention on the part of the user. I would suggest Ubuntu instead. 2) If you want to stay with Slackware then take a look at [Postgres](https://slackbuilds.org/slackbuilds/12.0/system/postgresql/README). This is from an older version of Slack but it should help some. There is also [Postgres blog](http://www.pmoghadam.com/homepage/HTML/slackware-13.37-postgresql-epkg.html). – Adrian Klaver Mar 25 '22 at 19:39
  • No yea I agree. I will use Slackware for programming in SML, Assembly, C/C++ and Linux Mint for SQL,Python, Ruby and JS. This is just too much of a headache to set up given the massive amount of frameworks, extensions, etc. I just want to get to work. – naarter Mar 26 '22 at 15:15

0 Answers0