Recorder which URL to use for MariaDB-> mysql:// or mysql+pymysql://?

Hi,
I’m interest to move my HomeAssistant (Hassio) DB SQLite in MariaDB (Add-on) but reading both page of MariaDB and Recorder, it is unclear which URL header I should use in Configuration.yaml.

Mysql or Mysql+pymysql?

Recorder:

  • db_url: mysql+pymysql://SERVER_IP/DB_NAME?charset=utf8
  • db_url: mysql+pymysql://user:password@SERVER_IP/DB_NAME?charset=utf8

MariaDB

  • db_url: mysql://hass:securePassword@core-mariadb/homeassistant?charset=utf8

Using just mysql will use the default driver which is mysql-python, specifying pymysql will use that python library as the driver. So both are valid. https://docs.sqlalchemy.org/en/latest/core/engines.html#mysql

I’d use the default driver (don’t specify +pymysql) if you are not sure.

1 Like

what did you use at the end?