> For the complete documentation index, see [llms.txt](https://docker.nailsapp.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docker.nailsapp.co.uk/containers/database.md).

# Database

A MySQL Database is made available via this container.

{% hint style="info" %}
This container is built from DockerHub using [`nails/docker-env-db`](https://hub.docker.com/r/nails/docker-env-db)
{% endhint %}

The Database container runs a MySQL database and is configured to create a default user as defined in `docker-compose.override.yml`.

By default you can connect to the database using the following credentials:

| Property                                                            | Value       |
| ------------------------------------------------------------------- | ----------- |
| Host (*inside* [web server container](/containers/web-server.md)):  | `db`        |
| Host (*outside* [web server container](/containers/web-server.md)): | `127.0.0.1` |
| Username:                                                           | `docker`    |
| Password:                                                           | `docker`    |
| Port:                                                               | `3306`      |
| Database:                                                           | `dev`       |

All database files are stored in `./docker/db/data` so that your data will survive containers being removed.

{% hint style="warning" %}
It is recommended to secure your installation using non-default credentials in non-development environments. Do this by adjusting the `docker-compose.override.yml` file.
{% endhint %}
