////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-module-mysql]]
== MySQL Module

This module periodically fetches metrics from https://www.mysql.com/[MySQL]
servers.

[float]
=== Module-Specific Configuration Notes

When configuring the `hosts` option, you must use a MySQL Data Source Name (DSN) of the
following format:

----
[username[:password]@][protocol[(address)]]/
----

[float]
=== Compatibility

The mysql MetricSets were tested with mysql 5.7.12 and are expected to work with all versions >= 5.7.0.


[float]
=== Example Configuration

The MySQL module supports the standard configuration options that are described
in <<configuration-metricbeat>>. Here is an example configuration:

[source,yaml]
----
metricbeat.modules:
- module: mysql
  metricsets: ["status"]
  enabled: true
  period: 10s

  # Host DSN should be defined as "tcp(127.0.0.1:3306)/"
  # The username and password can either be set in the DSN or for all hosts in username and password config option
  hosts: ["root@tcp(127.0.0.1:3306)/"]
----

[float]
=== Metricsets

The following metricsets are available:

* <<metricbeat-metricset-mysql-status,status>>

include::mysql/status.asciidoc[]

