MariaDB location?

Hello,
where in file system is MariaDB located?

Thank you.

Will be within the Docker container, normally you would connect to the server to access the data. The docs don’t state the port to connect on, suggest you try the default port listed in the MariaDB docs. Probably 3000 something

I just want to delete it and let the sytem create new one. I know I can do it via config but I find it easier to ssh to my Pi, find db file and delete it…

There are command line tools for database admin, but you will need the port

Hello,
what command line tools? :thinking: mysql doesnt work -> not found Hass.io command line is not standard command line, unfortunately :confused:
I tried recorder->purge from services, but my hass.io installation is still over 10GB

Thanks.

You would connect to the database server from another machine.
A quick google yielded https://www.mysql.com/products/workbench/

Ok. So I managed to connect to my db only gto find out, that my db is not the culprit. Any idea what can be eating my SD card space? My sensor.disk_used_home_2 shows 10.8 GiB

Thanks.

any luck on this yet? exactly my problem too.
No idea where the MariaDB is, and i’m far over that disk number…

Marius

Hello,
I didnt find it but I was able to connect to it using MySQL Workbench just to find out, that my DB was not eating disk space. I move to Intel NUC since then so I didnt continue this investigation…

Anyone found the location of MariaDB yet? Why these kind of things are not mentioned in the docs…

1 Like

If you used the default installation for MariaDB then your should find your databases located in /var/lib/mysql.

The homeassistant db should be in subfolder called homeassistant.

I tried going into the container like this:

root@myhost:~# docker ps

CONTAINER ID        IMAGE                                            COMMAND                  CREATED             STATUS              PORTS                                                                                      NAMES
d383f2893cd0        homeassistant/amd64-addon-mariadb:1.3            "/run.sh"                4 minutes ago       Up 4 minutes        0.0.0.0:3306->3306/tcp                                                                     addon_core_mariadb

root@myhost:~# docker exec -it d383f2893cd0 /bin/bash

bash-5.0# cd /data/databases/homeassistant
bash-5.0# rm *

It definitely deleted some stuff, but then mariaDB wouldn’t let hass recreate the tables because it said there was already a tablespace… So I think you’d probably want to do this in interactive mode, it doesn’t look as easy as deleting a MySQL database.

Anyhow what I ended up doing which was way quicker and easier was just to uninstall the MariaDB Hass.io addon (but first copied my settings out of the settings window for the addon). Installed it again, pasted the settings back in, and voila, databases were gone and homeassistant and the addon created them again. Took 3 minutes.

2 Likes

Hi all,
I got issue with Home Assistant Add-on: MariaDB
I’ve installed Home Assistant Add-on: MariaDB.
Now i installed Home Assistant Community Add-on: Portainer
Then in installed Wordpress via Portainer
But i don’t know how to connect Wordpress to MariaDB
Could someone help me
Thanks alot.

I don’t know anything about wordpress, but your database name and username and password are in the addon config. You will probably need to create some tables, I would guess using a script from wordpress, and probably should make a separate user. This is all just standard database stuff, so if you don’t understand databases, you might need to get someone who does to help.

Thanks @scstraus,
My issue was resolved. I forgot open port of host, just open port of portainer image.

Can you give some more info how to do that?
I’m getting Error establishing a database connection. I would like to run wordpress on my Pi4.

Thanks

For anyone that stumbles on this, if you are using Home Assistant OS and have set up host SSH access on port 22222 (For anyone that’s not familiar you have to generate and add an ssh public key to gain access to the host ssh) the MariaDB files are stored here: /mnt/data/supervisor/addons/data/core_mariadb

1 Like