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 ✨

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay