2020-02-29 00:43:59 +00:00
|
|
|
---
|
|
|
|
layout: default
|
|
|
|
title: MariaDB
|
2021-08-02 21:23:40 +00:00
|
|
|
parent: Storage Backends
|
2020-02-29 00:43:59 +00:00
|
|
|
grand_parent: Configuration
|
|
|
|
nav_order: 1
|
|
|
|
---
|
|
|
|
|
|
|
|
# MariaDB
|
|
|
|
|
2021-04-11 11:25:03 +00:00
|
|
|
The MySQL storage provider also serves as a MariaDB provider.
|
|
|
|
|
2022-05-10 03:41:07 +00:00
|
|
|
## Version support
|
|
|
|
|
|
|
|
We recommend using the latest version of MariaDB that is officially supported by the MariaDB developers. We also suggest
|
|
|
|
checking out [PostgreSQL](postgres.md) as an alternative.
|
|
|
|
|
|
|
|
The oldest version of MariaDB that has been tested is 10.6. If using 10.6 you may be required to adjust the
|
|
|
|
`explicit_defaults_for_timestamp` setting. This will be evident when the container starts with an error similar to
|
|
|
|
`Error 1067: Invalid default value for 'exp'`. You can adjust this setting in the mysql.cnf file like so:
|
|
|
|
|
|
|
|
```cnf
|
|
|
|
[mysqld]
|
|
|
|
explicit_defaults_for_timestamp = 1
|
|
|
|
```
|
|
|
|
|
2021-04-11 11:25:03 +00:00
|
|
|
## Configuration
|
|
|
|
|
2020-02-29 00:43:59 +00:00
|
|
|
```yaml
|
|
|
|
storage:
|
2021-11-25 01:56:58 +00:00
|
|
|
encryption_key: a_very_important_secret
|
2020-04-11 04:46:07 +00:00
|
|
|
mysql:
|
|
|
|
host: 127.0.0.1
|
|
|
|
port: 3306
|
|
|
|
database: authelia
|
|
|
|
username: authelia
|
|
|
|
password: mypassword
|
2020-02-29 00:43:59 +00:00
|
|
|
```
|
2020-04-23 01:11:32 +00:00
|
|
|
|
2021-04-11 11:25:03 +00:00
|
|
|
## Options
|
|
|
|
|
2021-11-25 01:56:58 +00:00
|
|
|
### encryption_key
|
|
|
|
See the [encryption_key docs](./index.md#encryption_key).
|
|
|
|
|
2021-04-11 11:25:03 +00:00
|
|
|
### host
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
2021-12-02 05:36:03 +00:00
|
|
|
required: yes
|
|
|
|
{: .label .label-config .label-red }
|
2021-04-11 11:25:03 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
The database server host.
|
2020-12-16 00:31:39 +00:00
|
|
|
|
2020-12-29 19:33:57 +00:00
|
|
|
If utilising an IPv6 literal address it must be enclosed by square brackets and quoted:
|
2020-12-16 00:31:39 +00:00
|
|
|
```yaml
|
|
|
|
host: "[fd00:1111:2222:3333::1]"
|
|
|
|
```
|
|
|
|
|
2021-04-11 11:25:03 +00:00
|
|
|
### port
|
|
|
|
<div markdown="1">
|
|
|
|
type: integer
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
default: 3306
|
|
|
|
{: .label .label-config .label-blue }
|
|
|
|
required: no
|
|
|
|
{: .label .label-config .label-green }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The port the database server is listening on.
|
|
|
|
|
|
|
|
### database
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
required: yes
|
|
|
|
{: .label .label-config .label-red }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The database name on the database server that the assigned [user](#username) has access to for the purpose of
|
|
|
|
**Authelia**.
|
|
|
|
|
|
|
|
### username
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
required: yes
|
|
|
|
{: .label .label-config .label-red }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The username paired with the password used to connect to the database.
|
|
|
|
|
|
|
|
### password
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
required: yes
|
|
|
|
{: .label .label-config .label-red }
|
|
|
|
</div>
|
2020-04-23 01:11:32 +00:00
|
|
|
|
2021-04-11 11:25:03 +00:00
|
|
|
The password paired with the username used to connect to the database. Can also be defined using a
|
|
|
|
[secret](../secrets.md) which is also the recommended way when running as a container.
|
2021-08-06 05:35:14 +00:00
|
|
|
|
|
|
|
### timeout
|
|
|
|
<div markdown="1">
|
|
|
|
type: duration
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
default: 5s
|
|
|
|
{: .label .label-config .label-blue }
|
|
|
|
required: no
|
|
|
|
{: .label .label-config .label-green }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The SQL connection timeout.
|