I installed the Home Assistant Operating System on my Intel NUC, the one where I exclusively run Home Assistant Operating System. After the installation all worked fine.
Somewhere I read that with such installation on the background dockers are used. Is there somewhere some more documentation around this? How to connect to such docker?
Reason for asking;
I want do to a mass load of data in the MariaDB and for that I want to do this via command prompt. If my understanding is correct then the MariaDB is automatically installed in such a docker and somehow I need to access that “MariaDB” docker to get to the command prompt.
I’m able to connect to the database via phpMyAdmin in HA and via HeidiSQL, that is not the problem.
But I want to move from SQLite to MariaDB, the data from SQLite I have exported but importing it via phpMyAdmin is not working due to the size. And via HeidiSQL I worked but took many days only to find out that I had to redo.
So I want to move the data to a file on my NUC and do the load directly via a local import in MariaDB. And for that it seems I need to have access to the command interface of MariaDB. And that one I can’t find.
Assuming you have configured command line access to your HASS server, and you are comfortable using the linux command line you can access MariaDB like this:
sudo docker exec -i -t addon_core_mariadb bash
This will put you in the bash shell of the docker container you referenced above. From there just run mariadb:
mariadb
use homeassistant
If you use the Studio Code Server Add-on, it gives terminal access to Home Assistant and can be leveraged for the above commands, as well as supports a free MySQL extension that allows direct access to MariaDB from Visual Studio Code.
Sorry, I mispoke. You have to run those command outside of the docker container you are in using Studio Code Server, e.g. from the host OS. Have you setup SSH to the host itself?
You can’t do this from the Studio Code server addon for multiple reasons:
It does not have nor need sudo (the addon runs as root within the container)
It does not have docker access
Unless the user above has made their own version of Studio Code Server with docker accesss, I’m not sure how they’re able to do that.
If you install the SSH & Web Terminal addon from community addons (not the one in official addons called Terminal & SSH) then that can be given docker access by turning off protection mode. Alternatively that addon has the mysql package preinstalled so you can do the import that way via CLI.
sudo command doesn’t seem to exist on the Home Assistant Operating System
I did the following installation:
Home Assistant Operating System: Minimal Operating System optimized to power Home Assistant. It comes with Supervisor to manage Home Assistant Core and Add-ons. Recommended installation method.
You’re also using the wrong SSH add-on if you’re trying to use the docker CLI
Alternatively if you just want to use the mysql CLI to do the import you can do that with either SSH add-on. The community one comes with that package pre-installed. It can be added to the official SSH add-on (the one you’re currently using) with apk add mysql
Do you still have the other ssh addon installed and running? If so then I assume its already bound to port 22 on the host, can’t have two containers bound to the same port.