From 62b6e6229783e822b2ab76b98744810165d46cce Mon Sep 17 00:00:00 2001 From: JudgeDredd <5932122+JudgeDreddKLC@users.noreply.github.com> Date: Mon, 26 Feb 2018 23:49:29 -0500 Subject: [PATCH] update recorder docs for mariadb 10.2 https://mariadb.com/kb/en/library/mariadb-1023-changelog/ Revision #1965f03 2016-11-26 22:22:50 +0100 Deb: Rename libmariadbclient-dev to libmariadb-dev --- source/_components/recorder.markdown | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/source/_components/recorder.markdown b/source/_components/recorder.markdown index 039d94ceb2d..ce32a6e1408 100644 --- a/source/_components/recorder.markdown +++ b/source/_components/recorder.markdown @@ -162,7 +162,17 @@ Not all Python bindings for the chosen database engine can be installed directly ### {% linkable_title MariaDB and MySQL %} -For MariaDB you may have to install a few dependencies. On the Python side we use the `mysqlclient`: +If you are in a virtual environment, don't forget to activate it before installing the `mysqlclient` Python package described below. + +```bash +pi@homeassistant:~ $ sudo su homeassistant -s /bin/bash +homeassistant@homeassistant:~$ source /srv/homeassistant/bin/activate +(homeassistant) homeassistant@homeassistant:~$ pip3 install mysqlclient +``` + +For MariaDB you may have to install a few dependencies. If you're using MariaDB version 10.2, libmariadbclient-dev was renamed to libmariadb-dev, please install the correct package based on your MariaDB version. + +On the Python side we use the `mysqlclient`: ```bash $ sudo apt-get install libmariadbclient-dev libssl-dev @@ -176,14 +186,6 @@ $ sudo apt-get install default-libmysqlclient-dev libssl-dev $ pip3 install mysqlclient ``` -If you are in a virtual environment, don't forget to activate it before installing the `mysqlclient` Python package. - -```bash -pi@homeassistant:~ $ sudo su homeassistant -s /bin/bash -homeassistant@homeassistant:~$ source /srv/homeassistant/bin/activate -(homeassistant) homeassistant@homeassistant:~$ pip3 install mysqlclient -``` - After installing the dependencies, it is required to create the database manually. During the startup, Home Assistant will look for the database specified in the `db_url`. If the database doesn't exist, it will not automatically create it for you. Once Home Assistant finds the database, with right level of permissions, all the required tables will then be automatically created and the data will be populated accordingly.