Database configuration settings
Configure the database environment in which Mattermost is deployed by going to System Console > Environment > Database, or by editing the config.json
file as described in the following table. Changes to configuration settings in this section require a server restart before taking effect.
Tip
Each configuration value below includes a JSON path to access the value programmatically in the config.json
file using a JSON-aware tool. For example, the SiteURL
value is under ServiceSettings
.
If using a tool such as jq, you’d enter:
cat config/config.json | jq '.ServiceSettings.SiteURL'
When working with the
config.json
file manually, look for the keyServiceSettings
, then within that object, find the keySiteURL
.
Driver name
Available in legacy Enterprise Edition E10/E20
Identify the type of database. Can be one of:
|
|
Data source
Available in legacy Enterprise Edition E10/E20
The connection string to the master database. String input |
|
To enable SSL:
|
|
MySQL databases When Driver Name is set to To specify collation: "SqlSettings": {
"DataSource":
"<user:pass>@<servername>/mattermost?charset=utf8mb4,utf8&collation=utf8mb4_general_ci",
[...]
}
If collation is omitted, the default collation, "SqlSettings": {
"DataSource": "<user:pass>@<servername>/mattermost?charset=utf8mb4,utf8",
[...]
}
Note: If you’re using MySQL 8.0 or later, the default collation has changed to |
|
PostgreSQL databases When Driver Name is set to |
Maximum idle connections
Available in legacy Enterprise Edition E10/E20
Maximum number of idle connections held open to the database. Numerical input. Default is 10. |
|
Maximum open connections
Available in legacy Enterprise Edition E10/E20
Maximum number of idle connections held open to the database. Numerical input. Default is 300. |
|
Query timeout
Available in legacy Enterprise Edition E10/E20
The amount of time to wait for a response from the database, in seconds, after opening a connection and sending the query. Numerical input in seconds. Default is 30 seconds. |
|
Maximum connection lifetime
Available in legacy Enterprise Edition E10/E20
Maximum lifetime for a connection to the database, in milliseconds. Use this setting to configure the maximum amount of time a connection to the database may be reused Numerical input in milliseconds. Default is 3,600,000 milliseconds (1 hour). |
|
Maximum connection idle timeout
Available in legacy Enterprise Edition E10/E20
Maximum time a database connection can remain idle, in milliseconds. Numerical input in milliseconds. Default is 300000 (5 minutes). |
|
Minimum hashtag length
Minimum number of characters in a hashtag. This value must be greater than or equal to 2. |
|
Note: MySQL databases must be configured to support searching strings shorter than three characters. See the MySQL documentation for details. |
SQL statement logging
Executed SQL statements can be written to the log for development.
|
|
Recycle database connections
Available in legacy Enterprise Edition E20
Select the Recycle Database Connections button to reconnects to the configured database. All old connections are closed after 20 seconds. To fail over without downing the server, change the
database line in the |
|
Disable database search
Available in legacy Enterprise Edition E10/E20
When other search engines are configured, such as Elasticsearch, the database can be disabled to perform searches.
|
|
Applied schema migrations
Available in legacy Enterprise Edition E10/E20
A list of all migrations that have been applied to the data store based on the version information available in the db_migrations
table. Select About Mattermost from the product menu to review the current database schema version applied to your deployment.