Start zammad postgresql from command line

Hello everyone,

Based on some of the other posts I came across, it seems like PostgreSQL uses socket authentication but I’m having trouble getting the console started on the command line.

I’ve tried the two commands below, but they ask for a password and don’t connect after the system replies “no password supplied”:
psql -h localhost -U zammad
psql -h localhost -U postgres

I have a feeling I’m missing a flag that signifies to connect with socket authentication, but I am not too familiar with PostgreSQL and the documentation didn’t really help me solve this. Any help is greatly appreciated.

When I run:
sudo psql zammad zammad

I get an error stating psql: FATAL: Peer authentication failed for user "zammad"

I looked in the pg_hba.conf and see where it applies peer authentication to certain users and databases, just afraid of adverse effects on the production Zammad system.

Thanks so much,

Edit: My hunch is the flag I want is unix_socket_directories (string) but I’m not sure where the socket directories are located in the system.

Hi there,

not quite sure what you are trying to achieve but just do this if you want to interact with the Zammad Database on PostgreSQL:

  1. login to your server
  2. su - postgres
  3. psql
  4. \c zammad

and you will see something like this:

$ psql
psql (10.6)
Type “help” for help.

postgres=# \c zammad
You are now connected to database “zammad” as user “postgres”.


You can have that even easier:

su - zammad

You’re in.

Zammad and it’s installer by default use socket based authentication which is why it doesn’t require any username and password in this case.

Also, what ever you’re trying to achieve, if it’s Zammad related (or you even want to change entries), you should not fiddle around directly in the database.

Thank you guys for the help. I should be able to handle it from here. Much thanks again!

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.