mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 08:16:53 +00:00
Add MySQL socket examples to recorder documentation (#15060)
* Add MySQL socket example * add example for non-pymysql one too
This commit is contained in:
parent
ab59840336
commit
2f6c83625d
@ -214,19 +214,22 @@ Note that purging will not immediately decrease disk space usage but it will sig
|
||||
|
||||
## Custom database engines
|
||||
|
||||
| Database engine | `db_url` |
|
||||
| :----------------------------- | :------------------------------------------------------------------------------------------- |
|
||||
| SQLite | `sqlite:////PATH/TO/DB_NAME` |
|
||||
| MariaDB (omit pymysql) | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MySQL | `mysql://SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MySQL | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MariaDB | `mysql+pymysql://SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MariaDB | `mysql+pymysql://user:password@SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| PostgreSQL | `postgresql://SERVER_IP/DB_NAME` |
|
||||
| PostgreSQL | `postgresql://user:password@SERVER_IP/DB_NAME` |
|
||||
| PostgreSQL (Socket) | `postgresql://@/DB_NAME` |
|
||||
| PostgreSQL (Custom socket dir) | `postgresql://@/DB_NAME?host=/path/to/dir` |
|
||||
| MS SQL Server | `mssql+pyodbc://username:password@SERVER_IP/DB_NAME?charset=utf8;DRIVER={DRIVER};Port=1433;` |
|
||||
| Database engine | `db_url` |
|
||||
| :----------------------------- | :----------------------------------------------------------------------------------------------------- |
|
||||
| SQLite | `sqlite:////PATH/TO/DB_NAME` |
|
||||
| MariaDB (omit pymysql) | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MariaDB (omit pymysql, Socket) | `mysql://user:password@SERVER_IP/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8` |
|
||||
| MySQL | `mysql://SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MySQL | `mysql://user:password@SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MySQL (Socket) | `mysql://user:password@localhost/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8` |
|
||||
| MariaDB | `mysql+pymysql://SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MariaDB | `mysql+pymysql://user:password@SERVER_IP/DB_NAME?charset=utf8` |
|
||||
| MariaDB (Socket) | `mysql+pymysql://user:password@localhost/DB_NAME?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8` |
|
||||
| PostgreSQL | `postgresql://SERVER_IP/DB_NAME` |
|
||||
| PostgreSQL | `postgresql://user:password@SERVER_IP/DB_NAME` |
|
||||
| PostgreSQL (Socket) | `postgresql://@/DB_NAME` |
|
||||
| PostgreSQL (Custom socket dir) | `postgresql://@/DB_NAME?host=/path/to/dir` |
|
||||
| MS SQL Server | `mssql+pyodbc://username:password@SERVER_IP/DB_NAME?charset=utf8;DRIVER={DRIVER};Port=1433;` |
|
||||
|
||||
<div class='note'>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user