Currently I am using HA in Docker on RPi 3 with a stock database.
Now I want to move to MariaDB installed on the same RPi.
I do not need to migrate old data to MariaDB, just want to start a new DB.
CREATE DATABASE home_assistant;
CREATE USER âSOME_USERâ IDENTIFIED BY âSOME_PASSWORDâ;
GRANT ALL PRIVILEGES ON home_assistant.* TO âSOME_USERâ;
FLUSH PRIVILEGES;
exit
Error during connection setup to mysql://SOME_USER:SOME_PASSWORD@localhost:3306/home_assistant?charset=utf8: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)") (Background on this error at: http://sqlalche.me/e/13/e3q8) (retrying in 3 seconds)
The history is not available, this error is displayed:
I am noob in databases.
Probably I installed MariaDB in a wrong way.
Can anyone help me?
Have to admit - people who wrote this article really do know the subject - but cannot write about it in a clear manner.
I am for 25 years in SW development, but never worked with databases. And I understand what is a clear algorithm. Those âinstructionsâ provided in the article - seem to be a pile of info, not an instruction at all.
Intro:
There is RPi 3 with LibreELEC (Kodi installed).
HA is installed in the Docker container.
MariaDB is to be installed in the Docker container too.
What I did is:
1 . Install MariaDB:
docker pull tobi312/rpi-mariadb
2 . Run MariaDB (invent & use your own SOME_ROOT_PASSWORD):
Note:
In my setup all user files are located in the "/storage" folder; the HA config also located there in the "/storage/HA" folder; the "/storage" folder was created by Kodi setup. The installed MariaDB has all db files in the "/storage/mariadb" folder.
3 . Setup database:
docker exec -it ha-mariadb mysql -u root -p
Password: SOME_ROOT_PASSWORD
Then type (invent & use your own SOME_USER & SOME_PASSWORD):
CREATE DATABASE home_assistant;
CREATE USER 'SOME_USER' IDENTIFIED BY 'SOME_PASSWORD';
GRANT ALL PRIVILEGES ON home_assistant.* TO 'SOME_USER';
FLUSH PRIVILEGES;
exit
4 . Add a line to ârecorder.yamlâ (use your own IP_ADDRESS, SOME_USER & SOME_PASSWORD):