2022-05-23 23:52:41 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1044, "Access denied for user 'homeassistant'@'%' to database 'ha_database'")
I’ve already tried a lot of different test and combinations without any success.
Can anyone point me in the right direction?
I guess this has something to do with the docker container with mariadb, which doesn’t provide the correct rights to make this connection work.
Yes, true… But I have been trying everything including changing credentials etc.
At the moment I managed to get it to work using mysql://root:password@...
Still any advice on how to configure this sql docker container?
As this seems to give the issue.
Somehow the user in the docker compose doesn’t get the right privilliges right away.
This would be desirable to get this right from the start of the config,… right?
Just as an update, I changed my compose file now to:
One thing from my setup
My main HA is running container under ‘host’ and this then works fine with the 192… to mariadb
However, my subprod instance is running under bridge and in that case I actually need to supply the ip of the maria-db-docker container (with me this is alike 172.17… For some reason I could not get it to work otherwise.
Changing the compose file will create a new container so I would expect that a new user (ha_user) will be created. Try from HeidiSQL to make sure it actually works.
You’re right that’s why I want it to work straight from the compose file without any other setup.
After relaunching the container this should keep working.
So everything works, in HeidiSQL I can see the changes in HA coming in.
Only using the MYSQL_USER, doesn’t work yet.
About the phpAdmin I’m not completely sure. Is this installed along the docker compose? Or do you need to install this seperately? Is it essential?
However I can see this data coming in:
Is similar as HeidiSQL…I use it for managing mysql. What is important to find out is if the userid that you use has sufficient rights to write/update tables
The fact that you have data coming in, is interesting as this collides with the error…or are these by ‘root’?
And indeed it’s working, was just curious about how to properly get this user fixed.
I’ll try to spin up a phpAdmin to have a webservice to monitor the db side.
Again though, you’re saying this is in the last docker compose file you used:
MYSQL_DATABASE: ha_db
So why are you using ha_database in your connection string? It should be ha_db like in the compose file, otherwise the user is granted permissions for a database that you don’t use from HA.