I just moved to MariaDB. Everything is working fine, I even deleted the old homeassistant.db file.
My question is: where are the files now? What if the DB gets corrupted or too big and I want to delete it, like I did before?
Can someone help me with an explanation please?
Maybe this will help you? I dont have MariaDB.
"
for MariaDB then your should find your databases located in /var/lib/mysql
." Bron: @bookmarker
It depends on how you installed HA and then how you installed MariaDB.
Sorry, then I don’t know.
If you are using Hass.OS, just remove the Maria_DB add-on and reinstall it, you will start with an empty database…
One last remark: make sure you do not have another database created within MariaDB (that you created for another application or purpose). If you have another database than “hass”, make sure that you have a full backup of that database before removing the add-on…
Ok, so there are no files in any folder?
If you installed mariadb via the add-on, the db is stored within the add-on’s docker container. Hence, remove the add-on (docker container), start over. This will also remove long term statistics.
Of course, there are files somewhere but in a specific container… So uninstalling the add-on, will remove the container and the database(s)… Why do you want to access those files ?
How do I know the size of the DB, I may want to purge it if it is growing to big for exemple…
The url will be something like…
mysql://YourUserName:YourPassWord@core-mariadb/homeassistant?charset=utf8mb4
you can add a user in the mariadb addon
make sure to change WHERE table_schema="homeassistant"
to homeassistant or actual db name
SELECT table_schema "database", Round(Sum(data_length + index_length) / 1024, 1) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;
You can make a sensor to show the size. It is done in the UI now.
You could also use myPHPadmin addon to dig around in it, probably quite easy to break stuff if you do that though.
Thank you, I will dig into it.
Thank you all for your inputs