WiredTiger file naming is based on the home
argument specified to the wiredtiger_open function and the WIREDTIGER_HOME
environment variable.
If a home
argument is specified to the wiredtiger_open function, its value is used as the database directory and the WIREDTIGER_HOME
environment variable is always ignored.
If no home
argument is specified to the wiredtiger_open function and 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.
If no home
argument is specified to the wiredtiger_open function, the WIREDTIGER_HOME environment variable is set, and the wiredtiger_open function was configured with the home_environment
string, the WIREDTIGER_HOME environment variable value is used as the database directory.
If no home
argument is specified to the wiredtiger_open function, the WIREDTIGER_HOME environment variable is set, the wiredtiger_open function was configured with the home_environment_priv
string, and the user has appropriate privileges, the WIREDTIGER_HOME environment value is used as the database directory. (The home_environment_priv
string is intended for applications that have or acquire special privileges and wish to ensure an environment-specified home directory is ignored unless the program is executed by a user with appropriate permissions: if such an application does not configure the wiredtiger_open function with the home_environment_priv
string, setting an environment value will cause the open to fail unless the user has appropriate permissions. On ISO/IEC 9945-1:1990 (POSIX.1) systems, "appropriate permissions" is defined as a real user ID of 0.)
If no home
argument is specified to the wiredtiger_open function, the WIREDTIGER_HOME environment variable is set, and the wiredtiger_open function was not configured with either the home_environment
or home_environment_priv
strings, the open will fail.
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.
The WiredTiger home directory optionally includes a file named WiredTiger.config
. If this file exists when wiredtiger_open is called, it is read for configuration strings. See WiredTiger Home Directory Configuration File for details.