Version 2.4.1
Database Home Directory

WiredTiger file naming is based on the home argument specified to the wiredtiger_open function and the WIREDTIGER_HOME environment variable, determined by the following steps:

  1. If a home argument is specified to the wiredtiger_open function, its value is used as the database directory.
  2. If the WIREDTIGER_HOME environment variable is not set, the database directory is the process' current working directory. No current working directory path is maintained by the WiredTiger software and changing the working directory after opening the WiredTiger database may cause failure.
  3. If the process is running with special privileges, the wiredtiger_open function must be configured with the use_environment_priv flag. The use_environment_priv flag is intended for applications that have or acquire special privileges and wish to use an environment-specified home directory: if such an application does not configure the wiredtiger_open function with the use_environment_priv flag, setting an environment value will cause the open to fail. On ISO/IEC 9945-1:1990 (POSIX.1) systems, "special privileges" is defined as a real user ID not equal to the effective user ID, or the real group ID not equal to the effective group ID.
  4. Otherwise, the value of the WIREDTIGER_HOME environment variable is used as the database directory.

Finally, consider security when configuring WiredTiger to use the WIREDTIGER_HOME environment variable, especially in applications which run with permissions other than the user's. Such applications are potentially vulnerable to allowing users access to databases they could not otherwise access.