Trying to setup MariaDB add-on but getting Recorder Could Not Start & Invalid Config error on reboot

Tags: #<Tag:0x00007f325a9eb388>

I’m running Hass.io on a VM if that helps. I followed the guide https://www.home-assistant.io/addons/mariadb/ exactly except I chose a different password to use and now when I reboot I get Errors “Recorder could not start, please check the log” and Invalid Config “The following components and platforms could not be set up: recorder, history, logbook, default-config”

I hit up the subreddit today and got a suggestion to try my system’s IP address instead of @core-mariadb and that didn’t work either.

my settings:

inside my yaml…

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: mydomain.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

recorder:
  purge_keep_days: 10
  purge_interval: 1
  db_url: mysql://hass:[email protected]/homeassistant?charset=utf8

history:

logbook:

and inside the add-on config…

{
  "databases": [
    "homeassistant"
  ],
  "logins": [
    {
      "username": "hass",
      "host": "%",
      "password": "MYchosenPASSWORD"
    }
  ],
  "rights": [
    {
      "username": "hass",
      "host": "%",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

had the same issues, create a new user and it will work again. Here’s my config

{
  "databases": [
    "homeassistant"
  ],
  "logins": [
    {
      "username": "hass",
      "host": "homeassistant",
      "password": "SOMEPASS"
    },
    {
      "username": "haasio_admin",
      "host": "%",
      "password": "somepass"
    }
  ],
  "rights": [
    {
      "username": "hass",
      "host": "homeassistant",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    },
    {
      "username": "haasio_admin",
      "host": "%",
      "database": "homeassistant",
      "grant": "ALL PRIVILEGES ON"
    }
  ]
}

for my recorder i use:

recorder:
  purge_keep_days: 5
  db_url: mysql://haasio_admin:[email protected]/homeassistant?charset=utf8

Thanks for the reply, I’m not 100% sure how I fixed it but… Got it to work FINALLY… had to change my config as follows:

Followed the section about Database Startup on page:


(SSH into my Ubuntu VM server and did the commands listed under DATABASE STARTUP, not sure if this contributed to things working for me or not?) instead of following example on the mariadb page… I had the add-on load the default config (except setup a chosen password) then…

inside config YAML I had to point to local IP address to my instance and make sure to leave off the extra stuff after /homeassistant (I thought I tried this as some point today but might’ve had one small item wrong when I did or the fact that I did the Database startup as mentioned on the recorder page that made it work finally?)

recorder:
  purge_keep_days: 10
  purge_interval: 1
  db_url: mysql://hass:[email protected]/homeassistant

How did you know that you can use core-mariadb as host for the database url?