I’m trying to generate an energy report. For that goal I want to query on the database in my case MariaDB.
In Node-RED I’m using the “node-red-contrib-stackhero-mysql” node. But I have also tried the “node-red-node-mysql” node.
The crazy thing is that it works but on some moments not. I have scheduled the task (of generating an energy overview mail) at 00:00. Tonight it hadn’t been running. But I have started it manually with the inject node and it works.
I get a lot of this errors in the Node-RED log:
12 Jan 15:18:21 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:18:41 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:19:01 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:19:21 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:19:41 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:20:01 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:20:21 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:20:41 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:21:01 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:21:21 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:21:41 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:22:01 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:22:21 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:22:41 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:23:01 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
12 Jan 15:23:21 - [error] [MySQLdatabase:HomeAssistant] Error: connect ECONNREFUSED ::1:3306
From Home Assistant recorder I use this connectionstring:
mariadb_url: 'mysql://homeassistant:xxxxxxxxxxxxxx@core-mariadb/homeassistant?charset=utf8mb4'
In Node-RED I have this configuration:
In phpMyAdmin I have those rights:
Do I have to do something special? Creating special user or do some configuration?