Many apologies if this is a real noob question - hopefully I’m just missing summat fundamental.
But I’m just getting going with grafana; I have a MySQL db that is populated with data from a number of sensors. The db is all good - I already have a simple php page that dumps the rows.
I’ve added the [local] mysql server as a data source, and it checks out ok with the “Save & Test”.
My db (“sonnet”) has this table:
CREATE TABLE `Measurements` (
`MAC` char(16) NOT NULL COMMENT 'Node Address',
`Time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Temp` decimal(3,1) DEFAULT NULL,
`RH` tinyint(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I’m trying to get started with just a Singlestat dashboard; I’ve selected my Data Source, set “Format As” Table; with the following SQL:
SELECT
UNIX_TIMESTAMP(Time) as time_sec,
Temp as value,
'Tempe' as metric
FROM Measurements
WHERE $__timeFilter(Time) AND MAC='00158D00001180FE'
ORDER BY Time ASC
But when I click on “Query Inspector”, it seems to come back with
xhrStatus:"complete"
request:Object
method:"POST"
url:"api/tsdb/query"
data:Object
from:"1533632362593"
to:"1533653962593"
queries:Array[1]
response:Object
results:Object
A:Object
message:"dial tcp 192.168.10.67:3306: connect: connection timed out"
Any help please on where I might be going wrong? In case it’s relevant, I’m running this all in a Docker Container on a QNAP/QTS NAS. (The MySQL server is outside the Container - but the “Save & Test” suggests it’s connecting to it ok?)
Thanks