# Connection with database error

**URL:** <https://discourse.nodered.org/t/connection-with-database-error/30172>\
**Category:** General\
**Created:** [16 July 2020 06:36 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172 "2020-07-16T06:36:54Z")\
**Posts on this page:** 16\
**Page:** 6

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 July 2020 12:56 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/102 "2020-07-17T12:56:31Z")

</div>

And what do **you** think that is telling you?

The mysql node is not finding any matching records where `rfidno` is equal to `E1234562`

To me that suggests that ID doesn't appear in the database. But that is something **you** have to find out.

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [17 July 2020 12:57 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/103 "2020-07-17T12:57:29Z")

</div>

Ya i got it .Thank You Sir for the solution .thank you very much

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [17 July 2020 13:01 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/104 "2020-07-17T13:01:53Z")

</div>

I want that String taken and send/pass to my MQTT out node so that i can catch this string in my mqtt subscriber code.how to do that?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 July 2020 13:06 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/105 "2020-07-17T13:06:55Z")

</div>

What does the MQTT node help text say about how to pass it data to publish?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 July 2020 13:10 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/106 "2020-07-17T13:10:25Z")

</div>

- you have already got msg.payload set to the value you want to be published.
- you have an MQTT out node ready to publish the message to topic you want

So how do you _think_ you might pass a message to the MQTT node?

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [17 July 2020 13:11 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/107 "2020-07-17T13:11:59Z")

</div>

like putting a mqtt out node in both the change node,am i right?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 July 2020 13:12 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/108 "2020-07-17T13:12:25Z")

</div>

The great thing with Node-RED is it is really quick and easy to _try_ things.

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [17 July 2020 13:15 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/109 "2020-07-17T13:15:50Z")

</div>

actually i have run the subscriber code but their i am not able to receive this string

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [17 July 2020 13:16 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/110 "2020-07-17T13:16:45Z")

</div>

You'll have to explain much more about what you have tried.

I assume you have the MQTT Out node configured with the right topic? And that you have wired the Change nodes to the MQTT Out node?

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [17 July 2020 13:18 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/111 "2020-07-17T13:18:02Z")

</div>

yes , i am trying onw more time Sir,if not get the output i will ask  
thank you Sir

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 July 2020 14:05 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/112 "2020-07-17T14:05:08Z")

</div>

Show us how you have configured the MQTT Out node and put a debug node showing what you are sending to that node.

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [20 July 2020 04:53 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/113 "2020-07-20T04:53:19Z")

</div>

![u](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ff24b1a8887bba3e606585eb83655451c1a39a6d.png)

yes @Colin Sir see this and please tell how can i do this

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [20 July 2020 05:02 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/114 "2020-07-20T05:02:09Z")

</div>

Please help anyone how can i do this

> [@knolleary](#):
>
> I assume you have the MQTT Out node configured with the right topic? And that you have wired the Change nodes to the MQTT Out node?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [20 July 2020 06:31 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/115 "2020-07-20T06:31:41Z")

</div>

The screenshot shows you have wired the change nodes to an MQTT node.

So what are you having a problem with?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 July 2020 08:31 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/116 "2020-07-20T08:31:42Z")

</div>

Shipra - in your screen shot, notice the red triangle on the `mqtt-out` node? That indicates you haven't configured it properly. You need to  
1 - point it at your mqtt broker (like you have done in the `mqtt-in` node)  
2 - define a topic to publish the message to.  
NOTE: do not use the same topic that the `mqtt-in` node uses to prevent a loop from occuring

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 August 2020 08:31 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/117 "2020-08-03T08:31:46Z")

</div>

Closed on 3 August 2020 08:31 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/connection-with-database-error/30172.md?page=5)
