Interface: mysql


The mysql interface is designed to allow communication with a MySQL database server, or one of its API-compatible descendants such as Percona XtraDB Cluster. The database server provides the mysql interface and database clients require it.

Relation Data

Key Set by Relation Type Description Example Value
database provides app Database name wp_data
user provides app User account with write access to the database user
password provides app Password for user A$#20kdsh2~!
host provides app Database hostname,
port provides app Database port.

When not set, requirers should default to 3306.
encoding requires app Text encoding that the provider should create the database with.

When not set, the provider defaults to utf-8.
latin-1, utf-8


Partner Event
1 both Relation established
2 requires relation-set encoding (optional, defaults to utf-8)
3 provides relation-set database
3 provides relation-set user
3 provides relation-set password
3 provides relation-set host
3 provides relation-set port
3 provides relation-set slave

Typical endpoint names


  • db


  • mysql
  • db


Hi @cory_fu, could you please check that this document is correct?

Could you please also check something for me? We have a live doc on the MySQL charm that refers to the “slave” key. Should that be deleted?