# Update MySQL Container

When running MySQL in Docker or as a container, you may need to update the version of MySQL from time to time.

## Ex: Update from MySQL 8.0.16 to 8.0.31 -&#x20;

To update MySQL within Docker using Docker compose, you need to update your "docker-compose.yml" file.

## 1 - Edit "docker-compose.yml" file:

Find this line in the MySQL block:

<pre><code><strong>image: mysql:8.0.16
</strong></code></pre>

Update the MySQL version in this line to the next version:

```
image: mysql:8.0.31
```

This will tell Docker which version of MySQL to use when deploying Monolith.

## 2 - Redeploy Monolith

Redeploy Monolith using the standard Docker compose command syntax:

```
docker compose down
docker compose up -d
```

This will stop the current Monolith deployment and restart it fresh containers.  You should see the new version of MySQL download as a Docker image during this process.

Once redeployed, MySQL will go through a breif process of updating itself that may last a minute or two, so it may take a minute or two for Monolith to be available for use.

## Conclusion

After completing steps 1 and 2, you should have a new version of MySQL installed and deployed for use with your Monolith deployment.


---

# 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://docs.monolithforensics.com/monolith/monolith-features/on-premises-deployments/update-mysql-container.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.
