I’ve been using MariaDB for my HA instance for a long time now. For what I’m not sure at least the last 4 or 5 updates the process to update something on the database fails. I get megs and megs of errors in the logs about trying to update keys and stuff. I have to purge the DB each time to get rid of it.
I know that it doesn’t really help you, but I have migrated to using MariaDB. Since then, I have successfully done three (or four?) updates with no errors/warnings. Are you using any custom integrations/weird configurations? Those might be causing your problems.
note also that the url you need to use has changed slightly. it used to include utf8 but that changed and you should now use utf8mb4
If you use the mariadb addon, remove the addon to delete the database. I comment out url in recorder restart HA, remove addon, add addon back, re edit url and restart so it forms a new db on next restart then remove the default database created.