# Configuring the Database

This guide explains how to configure the Morgana server to store data in a relational database.

## Supported Databases

The server has built-in support for different databases. You can query the available database by viewing the expected values for the `db` configuration option. The following table lists the supported database and their tested versions.

* MariaDB: 10
* MsSQL: 2016
* MySQL: 8
* Oracle: 12c
* Postgres: 10

By default, the server uses the `dev-file` database. This is the default database that the server will use to persist data and only exists for development use-cases. The `dev-file` database is not suitable for production use-cases, and must be replaced before deploying to production.

## Configuring a Database

For each supported database, the server provides some opinionated defaults to simplify database configuration. You complete the configuration by providing some key settings such as the database host and credentials.&#x20;

```
bin/kc.[sh|bat] start --db postgres --db-url-host mypostgres --db-username myuser --db-passowrd change_me 
```

This command includes the minimum settings needed to connect to the database.

The default schema is `Morgana`, but you can change it by using the `db-schema` configuration option.

## Relevant Options&#x20;

* `db`: The database vendor.
* `db-password`: The password of the database user.
* `db-pool-initial-size`: The initial size of the connection pool.
* `db-pool-max-size`: The maximum size of the connection pool.
* `db-pool-min-size`: The minimum size of the connection pool.
* `db-schema`: The database schema to be used.
* `db-url`: The full database JDBC URL.
* `db-url-database`: Set the database name of the default JDBC URL of the chosen vendor.
* `db-url-host`: Sets the hostname of the default JDBC URL of the chosen vendor.
* `db-url-port`: Sets the port of the default JDBC URL of the chosen vendor.
* `db-username`: The username of the database user.
* `transaction-xa-enable`: If set to false, Morgana uses a non-XA data source in case the database does not support XA transactions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ciusji.gitbook.io/morgana/guides/server-installation-and-configuration/configuring-the-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
