Skip to content

Commit 3319173

Browse files
nodomainfabaff
authored andcommitted
Fixed mySQL config documentation (home-assistant#1821)
I just did not work with the description before. See also https://community.home-assistant.io/t/error-in-setting-up-recorder-with-mysql/7705/2
1 parent 5fd4725 commit 3319173

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

source/_components/recorder.markdown

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ If you only want to hide events from e.g. your history, take a look at the [`his
9090
| Database engine | `db_url` |
9191
| :---------------|:---------------------------------------------------------|
9292
| SQLite | `sqlite:///PATH/TO/DB_NAME` |
93-
| MySQL | `mysql://SERVER_IP/DB_NAME` |
94-
| MySQL | `mysql://user:password@SERVER_IP/DB_NAME` |
93+
| MySQL | `mysql+pymysql://SERVER_IP/DB_NAME` |
94+
| MySQL           | `mysql+pymysql://user:password@SERVER_IP/DB_NAME`       |
9595
| PostgreSQL | `postgresql://SERVER_IP/DB_NAME` |
9696
| PostgreSQL | `postgresql://scott:tiger@SERVER_IP/DB_NAME` |
9797

@@ -105,8 +105,16 @@ For MySQL you may have to install a few dependencies:
105105

106106
```bash
107107
$ sudo apt-get install libmysqlclient-dev
108-
$ pip3 install mysqlclient
108+
$ pip3 install pymysql
109109
```
110+
If you are in a virtual environment, don't forget to activate it before installing the pymysql package.
111+
112+
```bash
113+
pi@homeassistant:~ $ sudo -i
114+
root@homeassistant:~# su homeassistant
115+
homeassistant@homeassistant:/root$ cd /srv/homeassistant/homeassistant_venv/
116+
homeassistant@homeassistant:/srv/homeassistant/homeassistant_venv$ source bin/activate
117+
(homeassistant_venv) homeassistant@homeassistant:/srv/homeassistant/homeassistant_venv$ pip3 install pymysql
110118
111119
### {% linkable_title PostgreSQL %}
112120

0 commit comments

Comments
 (0)