Qlik Sense Enterprise Forgot PostgreSQL password

A password is provided during the installation of Qlik Sense Enterprise on Windows. If you forget your password, you can’t retrieve it; however, you can reset it by following the steps below.

How to reset forgotten PostgreSQL password in Qlik… – Qlik Community – 1712725

If an incorrect password error is logged after the process is completed, see Qliksenserepository Password error in event log after changing database service user password… for more information.

  1. Stop all Qlik Sense services

    Verify that the Qlik Sense Repository Database service (or postgresql-x64-xx if the database is not a bundled installation and/or installed using QPI) is stopped.

    new service postgresqlx6412.png

    qlik sense repository database service.png

  2. The next step is to modify the pg_hba.conf and postgresql configuration files. We replace the currently active authentication method with Trust, allowing us to connect without a password.

    Please back up both files before modifying them.

    File Location:

    Default (bundled):

    C:\ProgramData\Qlik\Sense\Repository\PostgreSQL\12.5

    Alternative (non-bundled, custom installation):

    C:\Program Files\PostgreSQL\12.5\data

    *12.5 refers to the PostgreSQL version. Adjust accordingly according to the installed version.

  3. Open a text editor (such as Notepad or Notepad ++ ) As Administrator and browse to the .conf file location.

    If you don’t see the .conf file, switch the file view to All files (*) or All types, depending on your editor.

    all files or all types.png

  4. Open pg_hba.conf
  5. Change method from MD5 (choice: scram-sha-256) to trust

    Just change the first two lines of the IPv4 and IPv6 entries. I believe must be lowercase.

    Original:

    <span style="background-color:#f5f2f0"><span style="color:#000000"><code class="language-markup"># TYPE DATABASE USER ADDRESS METHOD
    
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5</code></span></span>

    Update:

    <span style="background-color:#f5f2f0"><span style="color:#000000"><code class="language-markup"># TYPE DATABASE USER ADDRESS METHOD
    
    # IPv4 local connections:
    host all all 127.0.0.1/32 trust
    # IPv6 local connections:
    host all all ::1/128 trust</code></span></span>
  6. Save the file and close it
  7. Start the Qlik Sense repository database (or postgresql-x64-xx).
  8. Start the Windows command line as administrator.
  9. From the command line, navigate to the PostgreSQL trash folder
    <span style="background-color:#f5f2f0"><span style="color:#000000"><code class="language-markup">cd "C:\ Program files\Qlik\Sense\Repository\PostgreSQL\12.5\bin"</code></span></span>

    *12.5 refers to the PostgreSQL version. Adjust accordingly according to the installed version.

  10. Run sql to connect to the database:
    <span style="background-color:#f5f2f0"><span style="color:#000000"><code class="language-markup">psql -h 127.0.0.1 - p 4432 -U postgres?</code></span></span>

    The response will provide the postgres=# prompt, which we will use to change the password.

    postgreqs prompt.png

  11. Continue from postgres=#

    The Qlik Sense PostgreSQL database has two users:

    postgre: superuserSuper user
    qliksense repository: Service consumer; this may be the only user setting if the database was installed manually or set up using QPI

    The password for both must be the same.

    1. Change the postgres user account (must contain single quotes and semicolon):
      <span style="background-color:#f5f2f0"><span style="color:#000000\ "><code class="language-markup">alter user postgres with encrypted password 'EnterYourNewPasswordHere';?</code></span></span>

      reply:

      response postgre user change.png

    2. Change the qliksense repository user account (must contain single quotes and semicolon):
      <span style="background-color:#f5f2f0"><span style="color:#000000"><code class="language-markup">alter user qliksenserepository with encrypted password \ 'EnterYourNewPasswordHere';</code></span></span>

      Reply:

      response qliksenserepository user change.png

  12. Close the command prompt.
  13. Adjust the connection string using QlikSenseUtil
    1. Open QlikSenseUtil (C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil)
    2. Open the Connection String Editor tab
    3. Click Read
    4. Adjust password
    5. Click Save values in encrypted configuration file

      qliksenseutil.png

  14. Change the microservice’s connection string as per Change the microservice’s connection string.
  15. Stop the Qlik Sense repository database (or postgresql-x64-xx).
  16. Revert the changes to the pg_hba.conf file, changing the method back from trust to md5 (alternative: scram-sha-256).
  17. Start all services (manual start and stop sequence for Qlik Sense services).

This concludes the required steps.

To verify that the password was changed correctly, you can run sql again, connect to the PG administrator, or view the Qlik Sense Repository logs for success messages on startup.

If an incorrect password error is logged after the process is completed, see Qliksenserepository Password error in event log after changing database service user password… for more information.

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. PostgreSQL skill treeSQL advanced skillsRecursive query 7054 people are learning the system