# 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:** 20\
**Page:** 1

<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:** [16 July 2020 06:36 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/1 "2020-07-16T06:36:54Z")

</div>

"ConnectionError: Login failed for user 'sa'."

getting this eeror i have created a databse name RFID\_ENTRIES1 ,and i am sending my data through mqtt node and data is getting correctly but i have to compare this data to my database ,i dont know why this error is coming?please help.

---

<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:** [16 July 2020 07:07 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/2 "2020-07-16T07:07:24Z")

</div>

Hi @shipra

In order to help we need some more information.

You have not told us what database technology you are using or what Node-RED node module you have installed to connect to the database.

The error says you have the login details for the database wrong. At this point, that's all we can say.

---

<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:** [16 July 2020 07:09 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/3 "2020-07-16T07:09:27Z")

</div>

yes ,i have taken mssql as database and node-red-contrib-mssql this as a node module

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

---

<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:** [16 July 2020 07:17 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/4 "2020-07-16T07:17:19Z")

</div>

Actually Sir I want to compare my MQTT RFID data with my database ,so how to do that ,please help me.Thank You

---

<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:** [16 July 2020 08:59 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/5 "2020-07-16T08:59:01Z")

</div>

So does this mean you have figured out how to connect to the database?

To compare data from two different places, you need to get the data into the same msg. In your case, you are sending data fron the RFID `mqtt-in` node to the mssql node. Put a `debug` node (set to displau the Complete msg object) on the output of both th e two nodes. Then you can see what the data looks like after exiting the `mssql` node.

I imagine that the `mssql` node will over write the msg.payload, so you will probably need to add a `change` node, between the two nodes, to copy the original msg.payload to another msg variable. Then in the output of the `mssql` node you should see all the information and be able to do what ever compares you need.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 July 2020 09:36 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/6 "2020-07-16T09:36:46Z")

</div>

> [@shipra](#):
>
> node-red-contrib-mssql

Hi, can I first recommend that you remove that node and instead install node-red-contrib-mssql-plus.

That node has not been updated in a long time and has known issues.

The one I recommend has active development, numerous bug fixes & many useful additional features.

---

<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:** [16 July 2020 09:36 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/7 "2020-07-16T09:36:55Z")

</div>

ok ,Actually i am new to node red and mssql ,so if you could send me with wriiten samples or pictures i can try this out.please help

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 July 2020 09:37 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/8 "2020-07-16T09:37:49Z")

</div>

Also, node-red-contrib-mssql-plus had built in examples and detailed documentation.

---

<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:** [16 July 2020 09:39 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/9 "2020-07-16T09:39:00Z")

</div>

Ok please if anyone could send me with demo or screenshots it would be a great help .Thank You.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 July 2020 09:40 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/10 "2020-07-16T09:40:07Z")

</div>

If you use the node I suggest and you fail to get it working, I will help you.

---

<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:** [16 July 2020 09:40 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/11 "2020-07-16T09:40:40Z")

</div>

Thank You @zenofmud ,Actually i am new to node red and mssql please if you can send me screenshots then it would be a great help.Thank You

---

<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:** [16 July 2020 09:42 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/12 "2020-07-16T09:42:00Z")

</div>

i have installed mysql server instead of mssql because i was stucked in that from past 2 days ,so just modifying my doubt to how to establish connection with mysql server with node red

---

<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:** [16 July 2020 09:42 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/13 "2020-07-16T09:42:36Z")

</div>

Have you taken the advice @Steve-Mcl has given you?

---

<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:** [16 July 2020 09:43 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/14 "2020-07-16T09:43:31Z")

</div>

yes,i am trying to follow but as i am new so clear picture I am not getting

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 July 2020 09:43 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/15 "2020-07-16T09:43:48Z")

</div>

Mysql is a completely different database so none of the MSSQL nodes will work.

---

<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:** [16 July 2020 09:44 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/16 "2020-07-16T09:44:42Z")

</div>

ya ,i have shifted this to different database ,now this time i want guidance so that error would not ocuur

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 July 2020 09:45 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/17 "2020-07-16T09:45:26Z")

</div>

Install mysql node not MSSQL nodes.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 July 2020 09:47 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/19 "2020-07-16T09:47:26Z")

</div>

Now use that one in your flow instead of MSSQL 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 09:27 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/20 "2020-07-17T09:27:45Z")

</div>

Anyone please tell how to read and verify my mqtt rfid no with my database rfid no please tell,as this node red platform has limitation on number of queries so I have to get the solution in quick manner.  
I am really looking for solution as i want to learn more.  
thank you

---

<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 09:39 UTC](https://discourse.nodered.org/t/connection-with-database-error/30172/21 "2020-07-17T09:39:21Z")

</div>

Have you succeeded in connecting to the database from node-red?  
Also which database type are you using?

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