This version brings the integration in line with the latest Home Assistant and HACS quality and security requirements, in preparation for its inclusion in the default HACS repository.
For most setups updating needs no changes. Your connections are converted automatically, query calls keep working for every user, from automations, scripts, dashboards and the developer tools, and so do execute calls from automations and administrators.
Check whether this applies to you
- You run Home Assistant older than 2026.3.0. HACS will not install this version there; stay on 3.2.0.
- A user who is not an administrator calls
execute, from a dashboard, the developer tools or the API. That call is refused now: writing is for administrators. Put the write in an automation and let the dashboard trigger it.queryis not restricted. - You still have a
mysql_query:section inconfiguration.yaml. Connections are set up in the UI only now. A connection imported from that section earlier keeps working; remove the section. A connection that exists only in YAML is not imported any more: add it in the UI. - A dashboard button or an API call puts a template in
valuesdirectly. That template is stored as text now instead of being rendered. Let the button run a script that makes the call. Automations, scripts and the developer tools need no change. - You send a write through
query.WITH ... UPDATE,WITH ... DELETEandSELECT ... INTO OUTFILEare refused there now and belong toexecute.
Good to know
- Some settings moved. Host, port, credentials, database, charset, collation and TLS are under Reconfigure; query timeout, row limit, autocommit and the read-only switch stay under Configure.
- Going back to 3.x means re-creating the connections, because the conversion is one way. Make a backup first if you may want to go back.
Security
querycould be used to write, throughWITH ... UPDATE/DELETE,SELECT ... INTO OUTFILEand executable comments (/*! ... */). These are refused now.- Every
queryruns inside a read-only transaction that is always rolled back, as an extra layer of protection: for an ordinary statement the server refuses to change a table, also through a stored function. It is not a permission system, because a statement that slips its ownCOMMITpast the integration's checks ends the transaction early. The real enforcement lies with the rights of the database user (see the recommendation below). - A value could be run as a template twice. Text coming out of a template, such as a sensor state that reads
{{ ... }}, was evaluated instead of stored. Values are now bound as they arrive. - Database messages are kept out of the log, because they can carry data from the row they are about. The full message stays in the response.
- Recommended: give a connection that non-administrators use a database user with
SELECTrights only, and do not grant theFILEprivilege. The checks in the integration keep a call on the right service; the rights of the database user decide what it can do. See Security best practice in the README.
New
- Reconfigure for the connection settings, tested before they are saved.
- A sign-in flow when the database refuses the credentials, at startup or during a call.
- Retry at startup when the database cannot be reached yet. A refusal that waiting does not fix (wrong credentials, unknown database, host not allowed, locked account, expired password, TLS not offered) fails with its own message instead.
executecan be called without aresponse_variable. A failing call without one stops the automation, because there is no response to report the failure in, unless it setsraise_on_error: false.
Fixed
- A cancelled call no longer hands a busy connection back to the pool, where the next call could read the leftovers of the statement.
- A call that is cancelled or times out frees its place in the pool. Before, five such calls left every following call waiting until its timeout, and unloading the connection hung.
Changed
- The password field is masked and never prefilled.
- Errors are raised as the kind Home Assistant expects, with translations.
- The TLS context comes from Home Assistant instead of being built on the event loop.
iot_classislocal_polling.
The full list is in the CHANGELOG.