Access to zammad database

Infos:

  • Used Zammad version: 3.3
  • Used Zammad installation source: (source, package, …) package
  • Operating system: Centos7
  • Browser + version: firefox 75

Expected behavior:

  • to access to my database and manipulate my tables

Actual behavior:

  • I am using postgresql database (by default)
  • I have installed zammad using rpm , during installation I didn’t configure anything about my database. So I dont know how to access to it and how to view or update my data stored in my tables.
    Is their any documentation?
    Is it doable just using rail console? or I can see database scheme and use query as select …from…

Steps to reproduce the behavior:

Hey @juliels,

what exactly are you doing and what is not working? Are there any error messages appearing?

I can connect to my postgres db just fine with the zammad db user by firing psql.

cheers

Hi @svnr-dvnkln , thank you for the response,

There is no error I am just asking a question,

I want to access to database using: psql DBNAME USERNAME -> I dont know the name of the database or the username( I am used to configure manually ma databases so in the case of zammad I dont know the parameter of the database or in which directory I can find the configuration of postgresql)

I have tried #psql zammad zammad
this is the error : psql: FATAL: authentification peer échouée pour l’utilisateur « zammad »

You will find the username (most certainly zammad) and password within database.yml. Assuming Zammad was installed to /opt/zammad, please run the following command:

cat /opt/zammad/config/database.yml

(or open the file in your favourite editor, i.e. vim or nano and look for password:)

1 Like

production:
adapter: postgresql
database: zammad
pool: 50
timeout: 5000
encoding: utf8
username: zammad
password:

and then I used #psql zammad zammad
'this is the error) # psql: FATAL: authentification peer échouée pour l’utilisateur « zammad »

I have solved my question:
to be able to access to my zammad database I had to change a line in the pg_hba.conf file:

#vi /var/lib/pgsql/data/pg_hba.conf
->add: local all all trust
(dont forget to restart service)
than:

#psql zammad zammad

I hope this will help others :slight_smile:

Just my two cents:
Allowing “all all” even if it’s just local, you’re basically disabling all authorization parts for your local environment. While this may be super easy to you, this might get a security issue on the other hand.

If you want to authenticate against psql, use either a password or su into the user Zammad.

Also, try to avoid to fiddle around in the database (especially as you’re talking about “manipulate”).
This might cause issues with your application nobody can foresee and help you with.

1 Like

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