I use docker-compose.yml to deploy MySQL, InfluxDB and Telegraf. I want to write the data of a MySQL database to an InfluxDB database through Telegraf. How to set the dsn of [inputs.sql] plugin while using telegraf to connect MySQL? Here are my settings:
It is said the dsn should be set as followed:
username:password@protocol(address)/dbname?param=value
My config turn out to be wrong:
E! [telegraf] Error running agent: starting input inputs.sql: connecting to database failed: dial tcp 192.168.48.5:3306: connect: connection refused
Can you tell me how to fix it? Thank you very much.
Looks like there is connection issue there. Could you first test your MySQL connection from where the Telegraf agent is deployed?
192.168.48.5:3306