Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to monitor mysql using NewRelic with integration in Linux?

What MySQL integration collects and sends?

NewRelic 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.

Compatibility and requirements

  • MySQL version 5.6 or higher.
  • Install the infrastructure agent
  • Install infrastructure on-host integrations

Our MySQL integration uses the New Relic Infrastructure agent to collect and send performance metrics from your MySQL database to our platform. You can see your database server’s health and analyze metric data so that you can easily find the source of any problems

Install and Configure Mysql Server in Centos

What is “infrastructure on-host integrations”?

New Relic’s on-host integrations are a type of infrastructure integration that collect data from core services running on your hosts, such as MySQL, Apache, or Redis, among others.

To collect data from on-host services, all you need are two things: the infrastructure agent, and the on-host integrations. All on-host integrations require that our infrastructure agent is installed on the host. Besides collecting system’s data, the agent acts as a forwarder for integrations’s data, and can forward logs.

Centos / RHEL – Install infrastructure on-host integrations for mysql in linux?

$ sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
$ sudo yum install nri-mysql
$ sudo systemctl restart newrelic-infra

# From the command line, create a user newrelic@localhost with a specific password by running:
$ sudo mysql -e "CREATE USER 'newrelic'@'localhost' IDENTIFIED BY $YOUR_PASSWORD WITH MAX_USER_CONNECTIONS 5;"

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

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

# Change the directory to the integration's folder.

$ cd /etc/newrelic-infra/integrations.d
$ sudo cp mysql-config.yml.sample mysql-config.yml

# Edit the configuration file mysql-config.yml as explained in the next section.

$ vi mysql-config.yml

$ Restart the infrastructure agent.

Ubuntu – Install infrastructure on-host integrations for mysql in linux?


$ sudo apt-get install nri-mysql -y
$ sudo systemctl restart newrelic-infra

# From the command line, create a user newrelic@localhost with a specific password by running:
$ sudo mysql -e "CREATE USER 'newrelic'@'localhost' IDENTIFIED BY $YOUR_PASSWORD WITH MAX_USER_CONNECTIONS 5;"

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

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

# Change the directory to the integration's folder.

$ cd /etc/newrelic-infra/integrations.d
$ sudo cp mysql-config.yml.sample mysql-config.yml

# Edit the configuration file mysql-config.yml as explained in the next section.

$ vi mysql-config.yml

$ Restart the infrastructure agent.

Reference

  • https://docs.newrelic.com/docs/integrations/host-integrations/installation/install-infrastructure-host-integrations/
  • https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/mysql-monitoring-integration/

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.