Hi,
Here’s a revised write up after I just installed everything for the first time and the writeups steps have changed - I struggled a bit.
I really experience a speed up in performance. I have a somewhat large system on hassio.
- Stats of my system (why I thought this would help)
- Phoscon (Conbee II Stick) : 85 device, 14 entities (xiaomi, ikea, sensors, lights etc)
- Google Cast : 10 Devices, 14 entities (those are speakers & chromecast sticks)
- Ikea: 63 devices, 56 entitites (ok, this is weird, I’ll check later!)
- Tuya: 24 devices, 23 entities (lamps, switches)
- and various others, broadlink, Node-REd, spotify, Synology
- Under “States” of developer tool, the table lists 555 items.
- This is on HASSIO, RPI4
*Before anything else: Backup system
Go to Supervisor> Snaptshots > Give it a name, then full snapshot (it takes 3-4 minutes) and Download it to your computer.
1> Install the addons.
- Under “Supervisor”, then addon store
- Search for "MariaDB, then “install”
- Go back, search for phpMyAdmin, then “install”.
- Don’t click yet on anything else.
2> Configure in MariaDB
- Under “Supervisor” click on “MariaDB”
- On top, go to “Confguration”
- Here’s my config - you can change it as wished. I added “Potatoe” to all the field that are “my own choice” so you know it’s not some part of code some directory or else… I know, I’m weird.
- Yes, the password I chose is crazy long so chose yours but at least 14 characters with upper case, lowercase, numbers, weird characters. My password in this example is: Ok_I_Will_Change_This_Later_Since_It_is_1_Password
Under “Configuration”:
databases:
- Potatoe_HASSIO_MariaDB_DATABASE
logins:
- username: Potatoe_HASSIO_MariaDB_USER
password: Ok_I_Will_Change_This_Later_Since_It_is_1_Password
rights:
- username: Potatoe_HASSIO_MariaDB_USER
database: Potatoe_HASSIO_MariaDB_DATABASE
Under “Network” (replace the “disabled” grey text by)
3307
Save.
- It might prompt you to restart - do so.
- Otherwise go back to “Info” in MariaDB, then make sure it’s running (if you see “START” click it) (you know it’s running if the options in red are “STOP” and “RESTART” (don’t click those!))
3> Magic
I realized that everything got auto configured - you can view it in in PhPmyAdmin. It created the table, the user and assigned the proper rights.
You can check bu need no actions:
- Supervisor, phpMyAdmin - make sure it’s running, if not, click “Start”
- The botom right, in blue, open Web UI
- You should see on the right menu in the center, your table that you created in step 2. No need to do anything here.
4> You need to add a bit of code to configuration.yaml
We will do this the secure way so you will “hide” the sensiste info in another file.
We will use a “secret” refference called “URL_MariaDB_Thing” so it’s not exposed when the system connects. (You can create your own secret name if you want instead of URL_MariaDB_Thing)
In configuration.yaml
recorder:
purge_keep_days: 10
purge_interval: 1
db_url: !secret URL_MariaDB_Thing
In secrets.yaml (if you don’t have this, create it as a new file in the same directory as configuraiton.yaml)
You need to replace in the link below, the following parts with your own info
- Potatoe_HASSIO_MariaDB_USER with what you chose in step 2 as username
- Ok_I_Will_Change_This_Later_Since_It_is_1_Password with what you chose in step 2 as your password
- 192.168.86.249:3307 with the ip adress of your hassio system - but leave :3307 at the end
- Potatoe_HASSIO_MariaDB_DATABASE with the name of the database you chose in step 2
- There is no paragraph mark / line break in the code below. It’s all in one long line
URL_MariaDB_Thing: mysql://Potatoe_HASSIO_MariaDB_USER:[email protected]9:3307/Potatoe_HASSIO_MariaDB_DATABASE?charset=utf8
5> Restart.
Some notes:
- It seems that MariaDB now can create the DB out of the box in its configuration.
- Other writeup were asking to configure things in phpmyadmin which got me confused and fail.
- Also, the tcp story in the config: I found that nowhere - I was just lucky to type the port in the field and it worked.