---
title: "node-red-node-mysql • FlowFuse Integrations"
description: "FlowFuse builds your first industrial solution with your team, proves it at one plant, then helps you roll it out to every plant, faster each time."
canonical_url: "https://flowfuse.com/integrations/node-red-node-mysql/"
meta:
  "og:description": "FlowFuse builds your first industrial solution with your team, proves it at one plant, then helps you roll it out to every plant, faster each time."
  "og:title": "node-red-node-mysql • FlowFuse Integrations"
---

> Index of every page on this site: [llms.txt](https://flowfuse.com/llms.txt)

# **node-red-node-mysql**

FlowFuse Recommended

A Node-RED node to read and write to a MySQL database

**Version:** 3.0.3**Weekly Downloads:** 1,989**Author:**Dave Conway-Jones**Updated:** Sep 11, 2026

## **FlowFuse Recommended Node **

FlowFuse recommends this node as a well-maintained, dependable choice for production Node-RED projects.

# node-red-node-mysql

A [Node-RED](http://nodered.org) node to read and write to a MySQL database.

## Install

Either use the `Node-RED Menu - Manage Palette - Install`, or run the following command in your Node-RED user directory - typically `~/.node-red`

```
npm i node-red-node-mysql
```

## Usage

Allows basic access to a MySQL database.

This node uses the **query** operation against the configured database. This does allow both INSERTS and DELETES.

By its very nature it allows SQL injection... so *be careful out there...*

The `msg.topic` must hold the *query* for the database, and the result is returned in `msg.payload`.

Typically the returned payload will be an array of the result rows.

If nothing is found for the key then *null* is returned.

The reconnect retry timeout in milliseconds can be changed by adding a line to **settings.js**

```javascript
mysqlReconnectTime: 30000,
```

The timezone can be set like GMT, EST5EDT, UTC, etc.

The charset defaults to the "old" Mysql 3 byte UTF. If you need support for emojis etc then use UTF8MB4.

## Preparing Queries

```javascript
msg.payload=[24, 'example-user'];
msg.topic="INSERT INTO users (`userid`, `username`) VALUES (?, ?);"
return msg;
```

with named parameters:

```javascript
msg.payload={}
msg.payload.userToChange=42;
msg.payload.newUsername="example-user";
msg.topic="INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;"
return msg;
```

## Documentation

[Documentation](https://www.npmjs.com/package/mysql) of the used Node.js package

## **Installation **

Install in Node-RED via the [**palette manager**](https://flowfuse.com/docs/node-red/getting-started/library/#using-the-palette-manager).

![Node-RED Palette Manager dialog with the node selected and the Install button visible.](https://flowfuse.com/images/integrations/palette-manager-install.png)

## **Quick Stats**

Current Version**3.0.3**

Weekly Downloads**1,989**

First Published**Jul 4, 2014**

Last Updated**Sep 11, 2026**

## **GitHub Stats**

[Open Issues ![GitHub Issues](https://img.shields.io/github/issues/node-red/node-red-nodes.svg?style=flat-square)](https://github.com/node-red/node-red-nodes/issues) [ Stars ![GitHub Stars](https://img.shields.io/github/stars/node-red/node-red-nodes.svg?style=flat-square)](https://github.com/node-red/node-red-nodes/stargazers) [ Forks ![GitHub Forks](https://img.shields.io/github/forks/node-red/node-red-nodes.svg?style=flat-square)](https://github.com/node-red/node-red-nodes/network/members)

## **External Resources**

[View on NPM](https://www.npmjs.com/package/node-red-node-mysql) [ View Repository](https://github.com/node-red/node-red-nodes)

## **Need Help?**

Get professional support for your Node-RED projects with FlowFuse.

[**Contact Us**](https://flowfuse.com/contact-us/)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://flowfuse.com/#website","@type":"WebSite","description":"FlowFuse builds your first industrial solution with your team, proves it at one plant, then helps you roll it out to every plant, faster each time.","inLanguage":"en","name":"FlowFuse","url":"https://flowfuse.com/","alternateName":["FlowForge","Flow Fuse"],"publisher":{"@id":"https://flowfuse.com/#identity"}},{"@id":"https://flowfuse.com/integrations/node-red-node-mysql/#webpage","@type":"WebPage","description":"FlowFuse builds your first industrial solution with your team, proves it at one plant, then helps you roll it out to every plant, faster each time.","name":"node-red-node-mysql","url":"https://flowfuse.com/integrations/node-red-node-mysql/","isPartOf":{"@id":"https://flowfuse.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://flowfuse.com/integrations/node-red-node-mysql/"]}],"primaryImageOfPage":{"@id":"https://flowfuse.com/#logo"}},{"@id":"https://flowfuse.com/#identity","@type":"Organization","legalName":"FlowFuse Inc.","name":"FlowFuse","url":"https://flowfuse.com","alternateName":["FlowForge","Flow Fuse"],"logo":{"@id":"https://flowfuse.com/#logo"},"sameAs":["https://twitter.com/FlowFuseinc","https://github.com/FlowFuse","https://www.linkedin.com/company/flowfuse/","https://www.facebook.com/FlowFuse/","https://www.youtube.com/channel/UCbBzP8NZbv3WDtlt4UouA-g"]},{"@id":"https://flowfuse.com/#logo","@type":"ImageObject","caption":"FlowFuse","contentUrl":"https://flowfuse.com/handbook/images/logos/ff-logo--square--dark.png","inLanguage":"en","url":"https://flowfuse.com/handbook/images/logos/ff-logo--square--dark.png"}]}
```

## Sitemap

See the full [sitemap](https://flowfuse.com/sitemap.md) for all pages.
