Creating and encrypting a credentials file with SQL DI shell CLI

To use the SQL Data Insights (SQL DI) shell CLI to enable AI query, you must first create one or two credentials files. A credentials file contains your user ID and password. With the credentials files, you no longer have to enter your SQL DI or Db2 user ID and password manually and repeatedly whenever you access SQL DI or connect to Db2 through the CLI.

Before you begin

You only need a single credentials file if you plan to use the same user ID and password to access your SQL DI and Db2 system. Otherwise, you must create two separate credentials files, one with the user ID and password for accessing SQL DI and the other for connecting to Db2.

Procedure

  1. In a bash session, change to the $SQLDI_INSTALL_DIR/sql-data-insights/bin directory.
  2. Invoke the sqldi.sh script by issuing the create_credential command with the -o option.
    ./sqldi.sh create_credential -o <yourCredentialFile>

    Where yourCredentialFile specifies the name and path of the output credentials file.

  3. Follow the onscreen prompts to enter the URL of your SQL DI server, your user ID, and password.

    SQL DI uses a login group to identify and authorize users. The default group name is SQLDIGRP. Make sure that the user ID that you specify is defined in your SQL DI login group.

    The credentials file is successfully created if the command returns a message similar to the following example:

    Your credentials are successfully stored in <yourCredentialFile>.
  4. Repeat the previous steps to create a second credentials file if you choose to separate the two sets of credentials.
  5. Set the user property to the credentials file in the input to a SQL DI shell command that you will issue.