glyn
(Glyn Davies)
August 26, 2018, 2:29pm
1
I am trying to run Home Assistant with a Maria database server running on a different Raspberry Pi. I hace successfully installed the database server on the non Home Assistant Pi but I cannot work out what client software I need to install on the Home Assistant machine.
I am running the latest Hassbian build.
Any ideas please.
Yuran
(Anders Yuran)
August 26, 2018, 3:05pm
2
If I understand your question correct you only need to change the settings in the configuration. Yaml under recorder:
glyn
(Glyn Davies)
August 27, 2018, 9:08am
3
Tried that but get the following message in homeassistant.log when it starts.
Error during connection setup: No module named ‘MySQLdb’ (retrying in 3 seconds)
I am assuming I must install the MSQL client on the Pi running hasbian but not sure how to do this without install the mysql server as well.
Yuran
(Anders Yuran)
August 27, 2018, 10:13am
4
For whar should you use the db?
Yuran
(Anders Yuran)
August 27, 2018, 10:14am
5
https://community.home-assistant.io/t/issue-with-remote-mariadb-using-hassio/48107
mistrovly
(Marc-Edouard Louis)
August 27, 2018, 10:50am
6
If you have your Home Assistant in a virtual environment, you’d probably need to install this:
sudo apt install libmysqlclient-dev
and also do this:
source /srv/homeassistant/bin/activate
pip3 install mysqlclient
Yuran
(Anders Yuran)
August 27, 2018, 10:52am
7
OK can be. I run mine in a docker on a dedicated ubuntu server with docker
mistrovly
(Marc-Edouard Louis)
August 27, 2018, 10:59am
8
As you are trying to use Docker I recommend you to use MySQL Docker image instead of using the Host MySQL.
Incase you still want to use the host mysql, you may need to do the following steps.
In your host mysql’s my.cnf set the bind address to 0.0.0.0 so that mysql listens on all network interfaces
glyn
(Glyn Davies)
August 27, 2018, 11:08am
9
Thanks for the suggestions. Managed to get it working by following the online documentation. Doh! Thought I had done that at the start.
pi@homeassistant:~ $ sudo -u homeassistant -H -s
homeassistant@homeassistant:~$ source /srv/homeassistant/bin/activate
(homeassistant) homeassistant@homeassistant:~$ pip3 install mysqlclient
and then:
$ sudo apt-get install libmariadbclient-dev libssl-dev
$ pip3 install mysqlclient
Next time I will make sure to RTFM!
1 Like