I have homeAssistant running in docker on a nuc using an SSL offloading proxy and seperate mariadb image. (see screenshot from portainer showing the 3 containers running). HomeAssistant seems unable to connect to the database image based on the docker image name (which is ‘mariadb’ in my case. I have created a database and user and granted the user rights to the database. here is the prhrase of my config that define the connection in homeAssistant
Thanks for this insight. And it even works. How persistent is the docker assigned IP address?
And even more interesting: it seems possible to refer using a name end it even worked in the past with my setup. But for now this works!
I’m having the same issues now. I moved mariadb from the windows based server to docker. Can access it fine with sqlworkbench but not from ha.
tried
db_url: mysql://username:[email protected]/homeassistant?charset=utf8
and
db_url: mysql://username:password@host_IP/homeassistant?charset=utf8
and
db_url: mysql://username:password@hostname/homeassistant?charset=utf8
HA and MySQL using same docker host?
if HA has local network access the host_IP should have no issue. Are you accessing through correct port? mysql://user:password@SERVER_IP:ALTERNATE_PORT/DB_NAME?charset=utf8mb4
Ha is on another server but same network. It was connected to the windows Maríadb server before (same host as new docker) and working fine. But just can’t get it to connect to the new instance in the docker. Port 3306 assigned.
Old Maríadb server shut down so no port conflict.
All sorted.
The container had port binding 127.0.0.1:3306 > 3306
I removed the IP so it was just 3306>3306
and added on the mariadb connection HOST_IP:3306
BUT still mysql consuming much more cpu than the mariadb addon. I’ve killed that. 10%
I’ll try the light version of maridb.