Skip to content

Commit 7ba8315

Browse files
datafxfabaff
datafx
authored andcommitted
Added instruction for Microsoft SQL Server (home-assistant#3035)
1 parent 000d5e1 commit 7ba8315

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

source/_components/recorder.markdown

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ha_release: pre 0.7
1414

1515
The `recorder` component is storing details in a database which then are handled by the [`history` component](/components/history/).
1616

17-
Home Assistant uses [SQLAlchemy](http://www.sqlalchemy.org/) as Object Relational Mapper (ORM). This means that you can now use **any** SQL backend for the recorder that is supported by SQLAlchemy, like [MySQL](https://www.mysql.com/), [MariaDB](https://mariadb.org/), or [PostgreSQL](https://www.postgresql.org/).
17+
Home Assistant uses [SQLAlchemy](http://www.sqlalchemy.org/) as Object Relational Mapper (ORM). This means that you can now use **any** SQL backend for the recorder that is supported by SQLAlchemy, like [MySQL](https://www.mysql.com/), [MariaDB](https://mariadb.org/), [PostgreSQL](https://www.postgresql.org/), or [MS SQL Server](https://www.microsoft.com/en-us/sql-server/).
1818

1919
The default database engine is [SQLite](https://www.sqlite.org/) which doesn't require any configuration. The database is stored in your Home Assistant configuration directory (`.homeassistant`) and called `home-assistant_v2.db`.
2020

@@ -96,6 +96,7 @@ If you only want to hide events from e.g. your history, take a look at the [`his
9696
| MySQL (pymysql) | `mysql+pymysql://user:password@SERVER_IP/DB_NAME` |
9797
| PostgreSQL | `postgresql://SERVER_IP/DB_NAME` |
9898
| PostgreSQL | `postgresql://scott:tiger@SERVER_IP/DB_NAME` |
99+
| MS SQL Server | `mssql+pymssql://user:pass@SERVER_IP/?charset=utf8` |
99100

100101
## {% linkable_title Installation notes %}
101102

@@ -127,3 +128,20 @@ For PostgreSQL you may have to install a few dependencies:
127128
$ sudo apt-get install postgresql-server-dev-X.Y
128129
$ pip3 install psycopg2
129130
```
131+
132+
### {% linkable_title MS SQL Server %}
133+
134+
For MS SQL Server you may have to install a few dependencies:
135+
136+
```bash
137+
$ sudo apt-get install freetds-dev
138+
$ pip3 install pymssql
139+
```
140+
141+
If you are in a virtual environment, don't forget to activate it before installing the pymssql package.
142+
143+
```bash
144+
$ sudo su -s /bin/bash homeassistant
145+
$ source /srv/homeassistant/bin/activate
146+
$ pip3 install pymssql
147+
```

0 commit comments

Comments
 (0)