# Database

{% 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 %}


---

# 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://docker.nailsapp.co.uk/containers/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.
