I’m trying to get a MariaDB SQL database running next to docker where I can record my events into.
At the moment I’m using the following docker compose for the database:
Here is the docker compose:
The *** passwords here are for test purposes the same
mariadb: container_name: mariadb image: yobasystems/alpine-mariadb restart: always environment: MYSQL_ROOT_PASSWORD: *** MYSQL_DATABASE: ha_database MYSQL_USER: homeassistant MYSQL_PASSWORD: *** PUID: 1000 PGID: 1000 volumes: - /opt/mariadb:/etc/mysql/conf.d - /opt/mariadb:/var/lib/mysql ports: - 3306:3306
The config is as follows:
recorder: purge_keep_days: 30 auto_purge: true db_url: mysql://homeassistant:***@192.168.2.61:3306/ha_database?charset=utf8
However when restarting I get this error:
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.
Thanks for the help!