I’m trying to create a sensor to measure my MariaDB size as per the docs. I’m using the mariadb addon and the same query works fine in the phpmyaddon when i execute it - i get a value as expected. I changed the db name to ‘homeassistant’ in the query.
However, the sensor shows as unknown and i get the following in my logs. What am I missing? The mariadb is used as my only recorder.
- platform: sql
queries:
- name: MariaDB Size
query: 'SELECT table_schema "database", Round(Sum(data_length + index_length) / POWER(1024,2), 1) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;'
column: 'value'
unit_of_measurement: MB
Error executing query SELECT table_schema “database”, Round(Sum(data_length + index_length) / 1024, 1) “value” FROM information_schema.tables WHERE table_schema=“homeassistant” GROUP BY table_schema LIMIT 1;: (sqlite3.OperationalError) no such table: information_schema.tables [SQL: SELECT table_schema “database”, Round(Sum(data_length + index_length) / 1024, 1) “value” FROM information_schema.tables WHERE table_schema=“homeassistant” GROUP BY table_schema LIMIT 1;] (Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation)