Unable to connect to MariaDB

I’m trying to connect to mariadb instance on my NAS with no luck.
I created a new user with full priviledges and a new db.
Then did the configuration in the recorder:

recorder:
purge_days: 7
db_url: mysql://username:pass@IP:PORT/db_name

but I can’t get it work.

Anyone that can help?

What’s the error message? Did you install the dependencies?

sudo apt-get install libmysqlclient-dev
pip3 install mysqlclient

@AlucardZero Yes I installed the dependencies. I don’t get any error in the home assistant log.

Any luck with this?

No unfortunately. But I was thinking trying again. There is a thread with a lot of info that can help you, until now nothing worked for me though.

More information than

will be needed for remote troubleshooting

@AlucardZero Well after replying to @gieljnssns I decided to try one more time and everything worked fine without any problem. A little difficult to identify the problem because some factors changed since the first time I tried, because I installed everything from scratch (Reinstalled raspbian and HA, factory reset and reinstalled MariaDB on my NAS)

Spent an hour trying to connect to a MariaDB on my NAS from my Macbook. Config setup below but no joy, any advice?

On Mac:
mysql -u hass -p -h 192.168.0.30 homeassistant-mariaDB

I was struggeling with this to, on my Synology NAS, but then I found out they have it running on port 3307!
After changing db_url to:
db_url: mysql://username:[email protected]:3307/hadatabase?charset=utf8
it connected to MariaDB10 on my DS412+ with no problems.

Also don’t forget the database has to exist before you connect to it. You’ll have to create it beforehand with phpMyAdmin, HeidiSQL or something like that.

1 Like

Did you ever get this working? I get an error on my mac ‘mysql: command not found’. Have tried installing but have running into other probs installing it. :frowning:

Suggest using the hassio addon https://www.home-assistant.io/addons/mariadb/