MySQL monitoring integration

Our MySQL integration collects and sends inventory and metrics from your MySQL database to our platform, where you can see the health of your database server and analyze metric data so that you can easily find the source of any problems.

A screenshot of example MySQL dashboards

To get the most out of this page, select the installation method that fits your environment. You need a New Relic account to finish the installation process.

Your environment

Check the compatibility and requirements

  • Our integration is compatible with MySQL version 5.6 or higher.
  • We require TLS version 1.2 or higher, with TLS authentication.
  • Install the infrastructure agent on a Linux or Windows OS host, or on a host capable of remotely accessing where MySQL is installed.

Enable your MySQL Server

To capture data from the MySQL integration, you must first create a MySQL user with replication and select permissions to allow the integration to fetch metrics.

  1. From the command line, create a user newrelic@localhost with a specific password by running:

    bash
    $
    mysql -e "CREATE USER 'newrelic'@'localhost' IDENTIFIED BY $YOUR_PASSWORD WITH MAX_USER_CONNECTIONS 5;"
  2. Grant replication privileges to newrelic@localhost, with a maximum of 5 connections, by running:

    bash
    $
    mysql -e "GRANT REPLICATION CLIENT ON *.* TO 'newrelic'@'localhost' WITH MAX_USER_CONNECTIONS 5;"
  3. Grant privileges to newrelic@localhost, with a maximum of 5 connections, by running:

    bash
    $
    mysql -e "GRANT SELECT ON *.* TO 'newrelic'@'localhost' WITH MAX_USER_CONNECTIONS 5;"

Install the MySQL integration

  1. Install the infrastructure agent, and replace the INTEGRATION_FILE_NAME variable with nri-mysql.

  2. Change the directory to the integrations configuration folder by running:

    bash
    $
    cd /etc/newrelic-infra/integrations.d
  3. Copy the sample configuration file by running:

    bash
    $
    sudo cp mysql-config.yml.sample mysql-config.yml
  4. Edit the mysql-config.yml configuration file with your favorite editor. Check out some configuration file examples..

  5. To enable automatic MySQL error log parsing and forwarding, copy or rename the mysql-log.yml.example file to mysql-log.yml, without needing to restart the agent:

    bash
    $
    sudo cp /etc/newrelic-infra/logging.d/mysql-log.yml.example /etc/newrelic-infra/logging.d/mysql-log.yml

Configure the MySQL integration (optional)

You can edit the mysql-config.yml configuration file, which is where you can place required login credentials and configure how data is collected, to match your setup and preferences. The configuration file has common settings applicable to all integrations like interval, timeout, or inventory_source.

To read all about these common settings refer to our configuration format standards.

Find and use data

  1. Go to one.newrelic.com > Integrations & Agents and type MySQL.

  2. Select Dashboards, and click MySQL overview dashboard. Installing the  MySQL dashboards

  3. In the popup window, select your account and set up MySQL, if you haven't already.

  4. Click View dashboard, and see your MySQL data in New Relic.

For more on how to find and use your data, see how to understand integration data.

Update the integration

This integration doesn't get updated automatically. For best results, regularly update the integration and the infrastructure agent.

Metrics collected by the integration

The MySQL integration collects the following metrics: