• Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Tech News, Magazine & Review WordPress Theme 2017
  • Tech
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    Exploring the Innovative Features of Pear Phones

    Exploring the Innovative Features of Pear Phones

    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    Master the World of Online Gaming with the Best Gaming VPN

    Master the World of Online Gaming with 3 Best Gaming VPN

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    5 Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

  • Crypto
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Business
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

No Result
View All Result
Geeky Insider
  • Tech
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    Exploring the Innovative Features of Pear Phones

    Exploring the Innovative Features of Pear Phones

    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    Master the World of Online Gaming with the Best Gaming VPN

    Master the World of Online Gaming with 3 Best Gaming VPN

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    5 Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

  • Crypto
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Business
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

Submit
Geeky Insider
No Result
View All Result

How to Monitor MySQL Server Activity With a Grafana Dashboard

by Staff Writer
August 17, 2022
in How To
Reading Time: 6 mins read
image of searching for the MySQL integration in Grafana
Share on FacebookShare on Twitter

Grafana is a popular open-source observability solution that lets you visualize metrics on graphical dashboards. Grafana has connectors for a broad selection of data sources including time series databases, search engines, and individual applications. In this article you’ll learn how to use Grafana to set up simple monitoring for a MySQL database server using the official Grafana Cloud integration.

Table of Contents

Toggle
  • Getting Started
    • READ ALSO
    • How to Activate Iphone With Sim Card
    • How to Quickly Divide or Split PDF Files
  • Adding the MySQL Integration
  • Installing Grafana Agent
  • Exploring Your Dashboards
  • Grafana Agent MySQL Server Authentication
  • Summary

Getting Started

Grafana’s available for self-hosting on your own hardware or as a managed SaaS platform called Grafana Cloud. We’re using Grafana Cloud in this tutorial because it supports quickstart integrations that connect to your data source and provide pre-built dashboard layouts for the most common metrics.

READ ALSO

transfer whatsapp from android to iphone

How to Transfer WhatsApp from Android to iPhone!

October 6, 2023
How to prevent phishing attacks

How to Prevent Phishing Attacks: Safeguarding Your Digital Identity

May 14, 2023

Sign in to your Grafana account to begin. You can create a new Grafana Cloud account for free to store up to 10,000 metrics series and 50GB of logs.

Adding the MySQL Integration

You can add the MySQL integration to your account by heading to the “Integrations and Connections” page, accessed from the lightning bolt icon in the left sidebar. Enter “mysql” into the search bar at the top of the screen.

You should see two results appear, both labelled “MySQL”. Choose the one that’s marked as an “Integration.” Integrations include a simplified configuration experience and pre-built dashboard layouts for monitoring key server statistics. The alternative option, “Data source,” requires you to manually connect to your server, extract metrics, and assemble dashboards.

image of installing Grafana's MySQL integration

The next screen will prompt you to select the operating system and processor architecture of the machine that’s hosting your MySQL server. Adjust the dropdown menu options to match your system. Press the blue “Install integration” button to view the appropriate Grafana Agent installation instructions.

Installing Grafana Agent

Grafana Agent is a utility that runs as a system service to collect metrics from your machines. It sends data up to your Grafana account where it’ll appear in your dashboards. The agent is a pared-down version of the Prometheus data collector.

 

Running the script shown on the MySQL integration screen will download Grafana Agent, configure it with your Grafana Cloud account, and set up MySQL monitoring. Data will be collected every 60 seconds when you’re using the default settings.

Copy the displayed script and run it on the server that’s hosting your MySQL databases. You’ll see a few lines of output as the script downloads the binary and retrieves your config file.

Check the Grafana Agent service has started successfully before you continue:

$ sudo systemctl status grafana-agent.service
● grafana-agent.service – Monitoring system and forwarder
Loaded: loaded (/lib/systemd/system/grafana-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-08-13 17:39:03 UTC; 39s ago
Docs: https://grafana.com/docs/agent/latest/

Press the “Test integration” button in your Grafana Cloud account to check everything’s ready to use. The agent should be feeding data up to Grafana.

 

You can now press “View Dashboards” to start interacting with the visualizations included with the integration.

Exploring Your Dashboards

The MySQL integration comes with two dashboards: MySQL Overview and MySQL Logs. The Overview dashboard provides graphs covering every aspect of your MySQL server’s operation, including uptime, queries per second, active connections, queries, sorts, and network activity. You can utilise these metrics to interrogate MySQL performance and identify optimization opportunities.

The Logs view offers a feed of the log files written by your MySQL server instance. The integration automatically collects the logs within the /var/log/mysql directory. The dashboard includes graphs of the number of log lines that have been written, broken down by severity level and error code.

The dashboards can be customized by clicking the settings icon in the top-right and pressing the “Make editable” button. This will let you change the dashboard’s configuration using the other controls on the settings screen. You’ll also be add to add and edit the graphical panels shown on the dashboard.

Grafana Agent MySQL Server Authentication

One challenge you might encounter concerns the MySQL user account that Grafana Agent uses to access your database. The agent is configured to use root by default. This won’t work if MySQL root login is disabled on your server, or you’ve blocked root connections to specific databases.

You can improve security and regain control by creating a dedicated MySQL user for Grafana. Run the following commands in a MySQL shell to add a user and password, then grant it privileges to access your data:

> CREATE USER ‘grafana’@’localhost’ IDENTIFIED BY ‘<your-password>’;
> GRANT ALL PRIVILEGES ON *.* TO ‘grafana’@’localhost’;
> FLUSH PRIVILEGES;

The privilege grant on *.* allows the user to access any table on your server, across all schemas. You could change the GRANT statement to restrict Grafana’s privileges or limit interactions to specific schemas and tables. However the integration works best with elevated privileges that include the MySQL system tables. This permits collection of the most comprehensive selection of metrics.

Once you’ve created your user, edit your Grafana Agent configuration file to authenticate with its credentials. You’ll find this at /etc/grafana-agent.yaml. Look for the following section:

integrations:
mysqld_exporter
:
data_source_name
: root@(localhost:3306)/

The data_source_name field defines the MySQL server address and user credentials. Modify it to reference your new account.

data_source_name: grafana:<your-password>@(localhost:3306)/

Restart the Grafana Agent service to apply the change.

$ sudo service grafana-agent restart

Summary

Grafana’s built-in MySQL integration provides a convenient way to monitor the performance of your database server. The included dashboard layouts aggregate your error logs and graph all commonly measured metrics, keeping you aware of resource utilization and query activity.

Regularly monitoring this data can help you spot emerging performance trends and resolve anomalies before they become a problem. Manually logging and retrieving these metrics would be a chore whereas Grafana dashboards give you everything on one screen, facilitating efficient analysis.



Source by www.howtogeek.com

Related Posts

How to Use the Text Command Excel
How To

How to Use the Text Command Excel

November 22, 2023
How to Communicate with Beeper Codes
How To

How to Communicate with Beeper Codes

November 4, 2024
transfer whatsapp from android to iphone
Articles

How to Transfer WhatsApp from Android to iPhone!

October 6, 2023
How to prevent phishing attacks
How To

How to Prevent Phishing Attacks: Safeguarding Your Digital Identity

May 14, 2023

Recommended.

Telegram voice note resized

Poll: Do you send voice notes on your smartphone?

October 31, 2022
How to restore WhatsApp chats- Technology News, Firstpost

How to restore WhatsApp chats- Technology News, Firstpost

August 31, 2022

Trending.

No Content Available
  • Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Contact us for submission queries. editor[at]geekyinsider.com.
No Result
View All Result
  • Home
  • Review
  • Apple
  • Gaming
  • Gadget and Gear
    • Camera
    • Smartphone
  • Microsoft
  • Security