Recorder MySQL error

I have installed home assistant to run in a python virtual environment on my Centos 7 server and works great.

I have MariaDB 10 already running on the server and I am trying to configure the home assistant recorder to use the MariaDB, I have created ha users/db and I have installed mysqlclient on the python virtual environment and added the following to configuration.yaml

recorder:
  db_url: mysql://hauser:hapass@localhost/homeassistant

But whenever I start home assistant I get the following recorder errors

thass[92585]: 2020-12-15 12:22:18 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: name '_mysql' is not defined (retrying in 3 seconds)

Any ideas to fix much appreciated…

Did you do what is documented here:

MariaDB and MySQL

If you are in a virtual environment, don’t forget to activate it before installing the mysqlclient Python package described below.


Yes I did, for everything that needed to be done in the virtual environment, looks like it all compiled and installed correctly, but when running up hass, the recorder is failing to find … name ‘_mysql’ is not defined …

I’m assuming its a package it can’t find external of the virtual environment but I have the mysql-client (MariaDB-client) installed