Set User Credentials for Event Repository Administration Scripts

Set user credentials for running Event Repository administration scripts. When authorization is enabled on your MongoDB system, every connection to a mongod server requires a username and a password with the appropriate access privileges.

About this task

A username and password must be supplied every time you run any of the Event Repository administration scripts against an Event Repository that has authorization enabled. You can use the MtxAdmin credentials (username and password) that you set when you created users on your MongoDB system or use different credentials. Note the following about providing a username and password when running the scripts.

Procedure

  1. The username. You can supply the username in one of the following ways:
    • Using the --user command line option of the script
    • Waiting to be prompted (run the script without specifying a username)
    • Putting the username in a file named ".mtx_event_repository_username" and saving this file in the current working directory or the home directory. This file must contain only the username and must reside in the current working directory or your home directory.
    Note: If special characters were used in the username when creating the MongoDB user, you must encode each special character to URL encoded format (percent encoding) when you set the username here. For more information, see the discussion about URL encoding for special characters in MongoDB user names and passwords.
  2. The password. You can supply the password in one of the following ways:
    • Wait to be prompted.
    • Having the password memorized. To have the password memorized, run any of the scripts without the --user option and without the .mtx_event_repository_username file on your system. You are then prompted for both the username and password. When asked if you want to save the password for future authentication, enter y for yes. The password for the corresponding username is memorized by the scripts.
    Note: If special characters were used in the password when creating the MongoDB user, you must encode each special character to URL encoded format (percent encoding) when you set the password here. For more information, see the discussion about URL encoding for special characters in MongoDB user names and passwords.

What to do next

If you must reset your password, to have the password memorized again, you must delete the .mtx_event_repository_username file from your system before having the reset memorized.