Configure Grafana with MySQL DataSource

Hi. I need help to configure Grafana with a MySQL DataSource.
I already have the DataSource configured, with no authentication problems; test OK, but all panels in Dashboard are empty (no data).
My DataBase is very simple; is called ‘raspduino’ and it has only one table ‘temperaturas’.
In that table, 9 rows. The first called ‘fecha’, and it contains UNIX TIME. From the second row to the ninth, called ‘sonda1’, ‘sonda2’…‘sonda8’, the values I want to put in Dashboards.
How can I archieve this?
Thanks, and excuse my english.

database name. Raspduino
Table: temperaturas

fecha,sonda1,sonda2,sonda3,sonda4,sonda5,sonda6,sonda7,sonda8
1516476761,24.69,24.62,24.56,24.56,24.50,24.62,24.69,24.50

1516476871,24.69,24.62,24.56,24.56,24.50,24.62,24.69,24.50

Hi,

So what does your query look like right now, i.e. are you doing a table or time series query?

Marcus

I just want to visualize a graph with the value of each sensor.
I don’t know how I have to configure into Graphana. I’m tryng to set a template query, but I don’t have graph. Only above the empty graph I can see a tags or dropdown menu with data retrieve by the query.

Okay. Something like this should work in my head:

SELECT
  fecha as time_sec,
  sonda1,
  sonda2,
  sonda3,
  sonda4,
  sonda5,
  sonda6,
  sonda7,
  sonda8
FROM 
  temperaturas
WHERE
  $__unixEpochFilter(fecha)
ORDER BY time_sec asc

Marcus

Thanks Marcus!
I was putting the queries in the wrong place. Now it runs!

1 Like