Recorder: mysql - changing hosts is failing

I moved my mysql to another host.

from Shared1 → Shared4.

updated configuration.yaml

from:
db_url: mysql://<hass_user>:<hass_pw>@shared1/hass_db
to:
db_url: mysql://<hass_user>:<hass_pw>@shared4/hass_db

now I get this error:
2021-09-01 22:42:13 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup to mysql://<hass_user>:<hass_pw>@shared4/hass_db: (MySQLdb._exceptions.OperationalError) (1045, "Access denied for user '<hass_user>'@'shared1' (using password: YES)")

error message seems to still be referring to old host?
(1045, "Access denied for user '<hass_user>'@'shared1' (using password: YES)")

The database comes up fine on the other host, and other applications connect perfectly to it.

any ideas whats going on here?

did you perform HA restart?

yep, multiple times. you can see that the first part of the error is right… and 2nd part is wrong.

heem based on the error you must be setting it incorrectly or maybe you have 2 db_url on secret.yaml?

thanks for the repsonse.

Okay… it works when I point it to shared1 and db is on shared1.

if I move db to shared2-4 and update the configuration as required… it fails and mentions shared1 in 2nd part of error.
If I move db back to shared1 and set config to shared1 it works again.

I have two other applications that are correctly working pointed to any host and connecting to database via sql developer works too!

I have checked secret.yaml file and its empty.
I have checked the rest of the configuration.yaml file and its only listed once.

what have I dont wrong haha ? I cant figure it out.
But having mysql locked to one host and because of HA is a bit of a pain :frowning:

any other ideas?

Thanks Jade

since you did not put secret on your recorder, I believe you should share your recorder setting? Maybe it will share some light?

I have been moving my DB from 1 point to another without any problem, so currently base on your error messages the DB is still pointing at the old DB which is different credential and being rejected.

its the same DB, I use rancher and longhorn.
and request that DB is started on another node.
so from the database perspective its exactly the same… db wont even know its happened… will shut down and start up and completely unaware its moved hosts.

I can connect to the new host from sql-developer fat client application on my desktop to new host and its all works as normal, other applications that are sharing same DB are able to connect.
its just HA im having issue with.

when you say share your recorder setting… I think I did above:
from:
db_url: mysql://<hass_user>:<hass_pw>@shared1/hass_db
to:
db_url: mysql://<hass_user>:<hass_pw>@shared4/hass_db

I have just removed username and password but the structure is exactly the same.

my guess at the time being is HA failed to reach the correct IP which is throwing out wrong password error. But other than that maybe someone else can help. I have not or test running mysql on kube, so again not sure

I tried another test.

had mysql on shared1 host.
had HA configuration pointed to shared4

Got a more expected error:
2021-09-02 04:40:17 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup to mysql://<hass_user>:<hass_pw>@shared4/hass_db: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on 'shared4' (115)")

I can ping the shared1-4 host from HA pod.

The part I dont get is in the error its referring to a host it shouldnt know anything about because I updated the configruation. But it mentions shared1?

does my head in haha.

thanks in advance.