Skip to main content
The MySQL Integration allows you to ingest and monitor the performance and health metrics of your relational database management system (RDBMS) data. This integration is useful for identifying top SQL operations by row, tallying total requests to MySQL handlers, and tracking worker thread count. There are two different methods for setting up the MySQL Integration. File-Baseed Authentication assumes you are a root MySQL user whereas User-Baseed Authentication allows you to connect the MySQL integration as a non-root user. Both installation methods will allow you to collect the same Metrics.

Prerequisites

Middleware Host Agent (MW Agent) must be installed on your local machine. To install the MW Agent, see our Installation Guide.

File-Baseed Authentication

Step 1: Create Database Credentials

Create a .yaml file containing database credentials like the below example. If the database is not password protected, the username and password fields can be removed. /home/ubuntu/mysql-creds.yaml
.yaml
For Docker users, create the credentials yaml file in the /var/log directory.

Step 2: Access Integrations

Log in to Middleware, navigate to the Installations Page in the bottom left corner, select All Integration and click MySQL

Step 3: Enable Integration

Add a host machine from the dropdown list, input the credential path from Step 1, and Save

User-Based Authentication

MySQL metrics are collected by querying performance_schema and sys_schema along with status variables that are managed by mysql-server. To allow for this collection you must create a non-root user with specific permissions described below.

Step 1: Create a User

Create a user named mw and specify your own unique password with the following command. mw will have the ability to login from any host unless otherwise specified.
To specify the specific host that mw can log into, change your above user name to the following: mw@'<hostaddr>'
Check if the user was created successfully by running the following command:
If successful, you will see the following output:

Step 2: Grant mw Permissions:

Grant mw permissions by running the following commands:

Step 3: Check Permissions

Ensure you have properly granted permissions to the mw user by running the following commands:

Visualize Analytics

Default MySQL Dashboard

Once the MySQL integration setup is complete, a new MySQL-specific dashboard will appear in the Dashboard Builder. This default dashboard serves as a jumping off point for visualizing and analyzing MySQL data.

Create MySQL Widget

MySQL data can be added to dashboards as a custom widget. When adding a new widget, select the mysql data source to view a full list of available MySQL data.

Alerts

Alerts can be configured for any MySQL metrics. When creating a new rule select the Database detection method and MySQL database type for available metrics to appear in the Metrics dropdown list. Select the desired metric and continue configuring the alert conditions.

Metrics Collected

Troubleshooting

If you do not see the Integrations Menu in Middlware, that means your account has not been granted Installation permissions. Contact your system administrator to add the Installation permission to your user role in Settings.

Next Steps

Need assistance or want to learn more about Middleware? Contact us at support[at]middleware.io.