DEV Community

François
François

Posted on • Originally published at blog.lepape.me on

2

How to add a MySQL Planetscale database as a grafana cloud datasource

The grafana cloud free plan is amazing for most of personal projects! I use it a lot on https://fixtheops.dev, and recently I wanted to display some data from my platnetscale mysql database to visualise the user growth. Platnetscale free plan being amazing as well, I highly advise the platform (https://planetscale.com/).

First you need to add a new datasource, in our case: mysql.

Then head over to Planetscale, and create a new password with read-only rights.

This part is important, as from grafana you can run DROP commands.

Then in the datasource add the host, user, password. As Planetscale is using SSL, make sure to toggle "With CA cert" option.

In authentication details, you need to provide the TLS/SSL root certificate. Here is how to obtain it:

# if you have pbcopy on mac:
curl https://letsencrypt.org/certs/isrgrootx1.pem | pbcopy

# otherwise, copy paste what you get from the curl command
curl https://letsencrypt.org/certs/isrgrootx1.pem
Enter fullscreen mode Exit fullscreen mode

How it should look like:

grafana-datasource

And here you are! All good to build beautiful dashboards for free ✨

AI Agent image

How to Build an AI Agent with Semantic Kernel (and More!)

Join Developer Advocate Luce Carter for a hands-on tutorial on building an AI-powered dinner recommendation agent. Discover how to integrate Microsoft Semantic Kernel, MongoDB Atlas, C#, and OpenAI for ingredient checks and smart restaurant suggestions.

Watch the video →

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay