# Node-red can't connect to SQL server

**URL:** <https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129>\
**Category:** General\
**Created:** [26 December 2018 08:33 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129 "2018-12-26T08:33:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [26 December 2018 08:33 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/1 "2018-12-26T08:33:46Z")

</div>

i can't connect node red to sql server, i use node-red-contrib-mssql, i try node-red-contrib-mssql-plus, aslo too. i configure firewall.

 ![sql](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4a8acc5ba7b76137948826f3ec131e88d368acd6.png)  
what should i do? Can you help me?

---

<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:** [26 December 2018 10:13 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/2 "2018-12-26T10:13:06Z")

</div>

Why are there errors shown trying to connect to DESKTOP-F4NTBU4 and 127.0.0.1 whereas the config shows 192.168.1.113? Are you sure those errors are coming from the node shown?

Also can you connect using a different client, from the same machine that is running node-red?

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [26 December 2018 16:59 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/3 "2018-12-26T16:59:14Z")

</div>

i test and connected to sql server by file.udl  
but i can't connect with node red

---

<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:** [26 December 2018 17:06 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/4 "2018-12-26T17:06:31Z")

</div>

@gaara7271 as @Colin said, the _only_ error in the debug sidebar that matches the configuration you've shown is the very last one - `Connection Refused`. Are you sure that is the right IP address? You have ticked the 'Use Encryption?' option - have you tried without that?

I have never used MSSQL so cannot provide any specific help, but right now it isn't clear how much you have tried yourself.

If it does work with a separate client, and you _sure_ you've used the same settings in Node-RED?

---

<div class="post-metadata">

**Author:** ![arneym](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/arneym/32/54_2.png) [@arneym](https://discourse.nodered.org/u/arneym)\
**Post date:** [27 December 2018 18:15 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/5 "2018-12-27T18:15:36Z")

</div>

Here is a look at my mssql-plus config:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0d3410dc1652f07fa401d63e08c92fe8bcc88b46.png)

Make sure that there are no typos in your Username and Password. I got the `Connection Refused` error when I fat fingered my credentials. I would also double check your Database name.

If your MSSQL server is also running your NodeRed instance, try using `localhost` instead of the IP.

---

<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:** [27 December 2018 22:21 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/6 "2018-12-27T22:21:45Z")

</div>

> [@gaara7271](#):
>
> i test and connected to sql server by file.udl

Did you do that from the same machine that is running node-red?

Can you post your udl file here? remove any sensitive data obviously.

---

<div class="post-metadata">

**Author:** ![gaara7271](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaara7271/32/7474_2.png) [@gaara7271](https://discourse.nodered.org/u/gaara7271)\
**Post date:** [28 December 2018 02:22 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/7 "2018-12-28T02:22:19Z")

</div>

i re-install sql server and I was successful, i don't know why  
thank you everyone

---

<div class="post-metadata">

**Author:** ![mauricio.lozornio](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mauricio.lozornio](https://discourse.nodered.org/u/mauricio.lozornio)\
**Post date:** [11 December 2019 18:48 UTC](https://discourse.nodered.org/t/node-red-cant-connect-to-sql-server/6129/8 "2019-12-11T18:48:50Z")

</div>

Hello @arneym , I have same issue, I typed my server name and still not connect, also the IP which was 127.0.0.1... I found it under Server configuration Manager -\> Protocols -\> TCP/IP properties... That is the IP showing in IP10 and dont know what to do.

I have MSSQL 2014 installed in a PC and a device that is programmed with nodered, both are connected to a ethernet switch.

Thanks!!
