---
title: Charmhub | Deploy Charmed MySQL Router using Charmhub - The Open Operator Collection
description: Deploy the latest version of Charmed MySQL Router on any cloud. MySQL
  Router
url: https://charmhub.io/mysql-router
---

# Charmed MySQL Router

[MySQL Charm Maintainers](https://charmhub.io/publisher/mysql-charmers "View all packages from MySQL Charm Maintainers")

* [MySQL Charm Maintainers](https://charmhub.io/publisher/mysql-charmers "View all packages from MySQL Charm Maintainers")
* [Cloud](https://charmhub.io/?filter=cloud)
* [Databases](https://charmhub.io/?filter=databases)

Platform:

26.04

24.04

23.10

23.04

22.10

22.04

21.10

21.04

20.10

+1

8.0/stable 04a4171

```
juju deploy mysql-router --channel 8.0/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Overview

The mysql-router charm provides a [MySQL 8 Router](https://dev.mysql.com/doc/mysql-router/8.0/en/); it proxies database requests from a principal application to a MySQL 8 InnoDB Cluster. MySQL Router handles cluster communication and understands the cluster schema.

It is a subordinate charm that is used in conjunction with the [mysql-innodb-cluster](https://jaas.ai/mysql-innodb-cluster) charm. It is also used with a principal charm that supports the ‘mysql-shared’ interface. The current list of such charms can be obtained from the [Charm Store](https://jaas.ai/search?requires=mysql-shared) (the charms officially supported by the OpenStack Charms project are published by ‘openstack-charmers’).

> **Important**: The eoan series is the first series supported by the mysql-innodb-cluster and mysql-router charms. These charms replace the [percona-cluster](https://jaas.ai/percona-cluster) charm starting with the focal series.

**Important:** This documentation supports version `3.x` of the Juju client.
See the [OpenStack Charm
guide](https://docs.openstack.org/charm-guide/latest/project/support-notes.html#breaking-changes-between-juju-2-9-x-and-3-x) if you are using the `2.9.x` client.

# Usage

The charm is deployed as a subordinate to a principal application and then related to the central mysql-innodb-cluster application:

```
principal charm A <---> mysql-router A <--->
principal charm B <---> mysql-router B <---> mysql-innodb-cluster
principal charm C <---> mysql-router C <--->
```

## [Configuration](https://charmhub.io/mysql-router#p-26281-configuration)

See file `config.yaml` for the full list of configuration options, along with their descriptions and default values.

## [Deployment](https://charmhub.io/mysql-router#p-26281-deployment)

To deploy a MySQL 8 Router for joining, say, Keystone to the cloud database:

```
juju deploy mysql-router keystone-mysql-router
```

> **Note**: The mysql-router application is typically given a name that corresponds to the associated principal application.

Add a relation to the principal application (via the [shared-db](https://github.com/openstack/charm-interface-mysql-shared) endpoint):

```
juju integrate keystone:shared-db keystone-mysql-router:shared-db
```

Then add a relation to the mysql-innodb-cluster application (via the [db-router](https://github.com/openstack-charmers/charm-interface-mysql-router) endpoint):

```
juju integrate keystone-msyql-router:db-router mysql-innodb-cluster:db-router
```

> **Important**: When network spaces are used, the mysql-router and mysql-innodb-cluster charms must be configured such that the ‘db-router’ endpoint is bound to the same space.

Scale out is accomplished by adding units to the principal application:

```
juju add-unit keystone
```

> **Note**: If more than one mysql-router application is placed on the same machine the `base-port` configuration option is needed to ensure non-conflicting TCP port numbers are used (the default is ‘3306’).

## [Actions](https://charmhub.io/mysql-router#p-26281-actions)

This section lists Juju [actions](https://jaas.ai/docs/actions) supported by the charm. Actions allow specific operations to be performed on a per-unit basis. To display action descriptions run `juju actions --schema mysql-router`. If the charm is not deployed then see file `actions.yaml`.

* `stop-mysqlrouter`
* `start-mysqlrouter`
* `restart-mysqlrouter`

# Documentation

The OpenStack Charms project maintains two documentation guides:

* [OpenStack Charm Guide](https://docs.openstack.org/charm-guide): for project information, including development and support notes
* [OpenStack Charms Deployment Guide](https://docs.openstack.org/project-deploy-guide/charm-deployment-guide): for charm usage information

# Bugs

Please report bugs on [Launchpad](https://bugs.launchpad.net/charm-mysql-router/+filebug).

---

[Help improve this document in the forum](https://discourse.charmhub.io/t/mysql-router-docs-index/11010) ([guidelines](https://discourse.charmhub.io/t/how-to-write-docs-our-documentation-guidelines-for-contributors/1245)). Last updated 2 years ago.
