Grafana docker version and mariadb on local VM

Hi Guys,

I’m running grafana using docker with this command
docker run -d -p 3000:3000 --name=grafana -v grafana-storage:/var/lib/grafana grafana/grafana

[root@xxxxxx]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
211b1c723a7e grafana/grafana “/run.sh” 13 minutes ago Up 12 minutes 0.0.0.0:3000->3000/tcp grafana

I can not set correct datasource for mysql.
My VM ip where mariadb (3306) is running is 172.17.0.1, in file /etc/my.cnf I’ve set bind-address = 0.0.0.0

[root@xxxxxxxx ]# lsof -i :3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 18456 mysql 13u IPv4 912744 0t0 TCP *:mysql (LISTEN)

so in mysql connection i’ve set
172.17.0.1 but in error I can see

Error 1045: Access denied for user ‘root’@‘172.17.0.2’ (using password: YES)

I’m sure that user and password is correct because I can use this credential to open mariadb from command line

grafana container have ip 172.17.0.2

Any hints?

I am not very related to the commands to solve it, but I think it is due to the permissions that the user has, I believe that only the login is allowed from localhost not from the grafana ip