Searching for a howto to connect to local mariadb with docker HASS (without supervisor) on Raspi4

Hope it doesn’t turn out that I don’t see the forrest for all the trees, but I keep getting stuck with the following topic.
I have a running raspi4 with docker traefikv2 and home assistant + a local installation of mariadb on the very same raspi. As I don’t have supervisor I would need to configure the connection to mariadb manually. Question is how? As I don’t seem to find any community integrations on this and all queries end up describing the procedure involving the supervisor. Could somebody please point me to such a tutorial, or can we use this thread to create such a step by step instruction?

If I understand it correct, you’re just searching where to put in the DB address/port/passwd?

That would be the recorder component. Take a look here, especially the sections at the end of that page.

In simple words, it is something along these lines:

recorder:
  db_url: mysql+pymysql://user:password@SERVER_IP/DB_NAME?charset=utf8mb4

Thx for the hint. I set the this up accordingly and tested the configuration, which turned out to be good.
However I have now this in my logs:
Error during connection setup to mysql+pymysql://xxxx:[email protected]/homeassistant?charset=utf8mb4: No module named ‘pymysql’ (retrying in 3 seconds)

which brought me to this link: The official docker image is missing pymysql · Issue #28812 · home-assistant/core · GitHub. Which states that there is an issue with the docker image.
I tried this command:
sudo docker exec homeassistant pip3 install --no-cache-dir -U pymysql (succesfully)

But I still don’t see any tables in the database. Instead I get a new error in my logs:

Error during connection setup to mysql+pymysql://xxxx:[email protected]/homeassistant?charset=utf8mb4: (pymysql.err.OperationalError) (2003, “Can’t connect to MySQL server on ‘192.168.1.2’ ([Errno 111] Connection refused)”) (Background on this error at: http://sqlalche.me/e/14/e3q8) (retrying in 3 seconds)

I believe this the case since it is not localhost trying to connect. I will make some changes to the user within mariadb.

Yes, as as expected the two things remaining where the change of the binding to 0.0.0.0 and to allow the user to access remotely within the mariadb.
Thx for the hint and I hope this is also usefull for somebody running into the same issue as I did.

Great it worked! :slight_smile: