---
title: "MySQL Query Service"
description: "MySQL Query Service is a Marketplace integration for Home Assistant. It has 50 installs sharing analytics, works locally and was last updated November 5, 2026."
canonical: "https://vulpo.app/integrations/marketplace/iasdoubleyou-homeassistant-mysql-query"
url: "https://vulpo.app/integrations/marketplace/iasdoubleyou-homeassistant-mysql-query.md"
last-updated: "2026-11-09"
version: "1.4"
---

# MySQL Query Service

> MySQL Query Service is a Marketplace integration for Home Assistant. It has 50 installs sharing analytics, works locally and was last updated November 5, 2026.

MySQL Query Service is an integration that reads from and writes to a MySQL or MariaDB database through actions. It adds a Query action for statements that only read and an Execute action for statements that change data or schema, and each refuses the other's kind of statement. Both actions can return their result as response data, which can be used from a template. Values can be passed separately from the statement as parameters, and several connections can be configured, with one chosen per call. Safeguards include a row limit, a query timeout, optional read-only connections, and optional TLS encryption that does not verify the server certificate. Connections are set up in the UI and run locally against the database.

Automatic summary of the README and code of IAsDoubleYou/homeassistant-mysql\_query. Something wrong, or are you the maintainer and want your own text here? [Get in touch](https://vulpo.app/support)

[Open in My Home Assistant](https://my.home-assistant.io/redirect/marketplace_repository/?owner=IAsDoubleYou&repository=homeassistant-mysql_query&category=integration)

On Home Assistant 2026.10 or older? [Open it in HACS](https://my.home-assistant.io/redirect/hacs_repository/?owner=IAsDoubleYou&repository=homeassistant-mysql_query&category=integration)

## Supports

- **Works locally**: Talks to your devices on your own network. No vendor cloud in between.
- **From the Marketplace**: Installed through the Marketplace, formerly HACS.
- **Actively maintained**: Its author released or pushed a change in the last six months.

## Setting it up

Install it from the Marketplace and restart Home Assistant, then add it under Settings, Devices and services.

### Connect to your MySQL Database

- **Host**
- **Port**
- **Username**
- **Password**
- **Database**
- **Connect Timeout (seconds)**
- **Query Timeout (seconds)**: Sets the maximum duration for the entire database operation. If a query exceeds this limit, the action is cancelled and the connection is rebuilt.
- **Charset**
- **Collation**
- **Autocommit**
- **Row Limit (Safety Cap)**
- **Encrypt the connection (TLS)**: Encrypts the traffic to the database. The server must have TLS configured; the connection fails if it does not. The server certificate is not verified, so this protects against reading along on the network, not against a server impersonating yours. Off by default so existing setups keep working.
- **Read-only connection**: Prevents write operations from being executed on this connection. Useful to protect connections used only for dashboards and reports against accidental modifications.

### Sign in again

- **Username**
- **Password**

### Change the connection

- **Host**
- **Port**
- **Username**
- **Password**: Leave empty to keep the current password. It is not shown here.
- **Database**
- **Connect Timeout (seconds)**
- **Charset**
- **Collation**
- **Encrypt the connection (TLS)**: Encrypts the traffic to the database. The server must have TLS configured; the connection fails if it does not. The server certificate is not verified, so this protects against reading along on the network, not against a server impersonating yours. Off by default so existing setups keep working.

### After setup

- **Query Timeout (seconds)**: Sets the maximum duration for the entire database operation. If a query exceeds this limit, the action is cancelled and the connection is rebuilt.
- **Row Limit (Safety Cap)**
- **Autocommit**
- **Read-only connection**: Prevents write operations from being executed on this connection. Useful to protect connections used only for dashboards and reports against accidental modifications.

Texts from the code of [IAsDoubleYou/homeassistant-mysql\_query](https://github.com/IAsDoubleYou/homeassistant-mysql_query).

## Actions

- **Execute**: Runs a statement that changes something (INSERT, UPDATE, DELETE, DDL, and maintenance statements such as ANALYZE or OPTIMIZE) and returns what it affected. Refuses a statement that only reads; use Query for that.
  Fields: Query, Values, Database override, Connection, Raise on error
- **Query**: Runs a statement that only reads - SELECT, WITH, SHOW, DESCRIBE, EXPLAIN and the like - and returns the rows together with the metadata about the result. Refuses anything that changes data or schema; use Execute for that.
  Fields: Query, Values, Database override, Connection, Raise on error

## Troubleshooting

- **Diagnostics**: Downloads a diagnostics file to attach to a bug report.

## From the README

> Looking for continuous sensors instead of actions you trigger on demand? See HA MySQL, a sibling integration built for that — full comparison at the bottom of this README.
>
> A Home Assistant custom component that talks to a MySQL or MariaDB database through two actions: mysql\_query.query reads with a SELECT and hands you the rows, and mysql\_query.execute writes with an INSERT, UPDATE, DELETE or DDL statement and hands you what it changed. Both can return their result as response data you can use straight from a template.
>
> - UI configuration: add a connection, change it later from the menu of the connection, and sign in again from a prompt when the database refuses the credentials.
> - Reading and writing are separate: query runs only statements that read, execute only statements that change something. The wrong one gives an error naming the right one.
> - Parameterized queries: pass values separately with values and %s placeholders, so the database escapes them for you.
> - Guard rails: a row limit, a query timeout, one statement per call, optional read-only connections, writes for administrators only, and optional TLS.
> - Multiple databases: configure several connections and pick one per call, or use db4query for another database on the same server.
> - Robust: pooled connections, calls on one connection queue instead of interleaving, and a connection that cannot be reached at startup is retried by itself.
> - JSON-safe results: MySQL types such as DECIMAL, DATE and TIME are converted automatically.

From the README of [IAsDoubleYou/homeassistant-mysql\_query](https://github.com/IAsDoubleYou/homeassistant-mysql_query#readme), [MIT License](https://spdx.org/licenses/MIT.html). Shortened.

## At a glance

- Kind: Marketplace integration
- Category: [DIY and makers](https://vulpo.app/integrations/category/diy-and-makers.md), Web and data connectors
- Number: 50 installs sharing analytics; 17 GitHub stars
- Connection: Works locally
- Upkeep: Updated in the last 6 months
- Needs: Needs the Marketplace (HACS on 2026.10 and older)
- Latest version: v4.2.1, last updated November 5, 2026
- Domain: `mysql_query`
- Source: <https://github.com/IAsDoubleYou/homeassistant-mysql_query>
- Issues: <https://github.com/IAsDoubleYou/homeassistant-mysql_query/issues>

Independent directory, made by the developer of Vulpo. Not affiliated with Home Assistant or the Open Home Foundation. [About these numbers](https://vulpo.app/integrations/about)

Last updated 2026-11-09. Source: https://vulpo.app/integrations/marketplace/iasdoubleyou-homeassistant-mysql-query

---

- HTML version of this page: https://vulpo.app/integrations/marketplace/iasdoubleyou-homeassistant-mysql-query
- Site index for agents: https://vulpo.app/llms.txt
- Everything in one document: https://vulpo.app/llms-full.txt
- All pages: https://vulpo.app/sitemap.xml
