# Cannot connect to Database

**URL:** <https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702>\
**Category:** Ignition\
**Created:** [January 29, 2020, 12:58am UTC](https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702 "2020-01-29T00:58:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [January 29, 2020, 12:58am UTC](https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702/1 "2020-01-29T00:58:52Z")

</div>

I am trying to connect to database using Listeners/DNS but it gives out the error !

Here’s how the connection string looks like :  
`jdbc:sqlserver://Listener[: Port]`

The Error I am getting is -

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/aa38ec20be65e73083f6f058e24f6a8809e05636.png)

Whereas when I connect directly to a node, it works fine !

Thanks !

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 29, 2020, 1:09am UTC](https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702/2 "2020-01-29T01:09:06Z")

</div>

Get rid of any square brackets you’ve got in your connection path. That syntax is usually used in documentation to indicate something is optional. In this case it looks like specifying the port is optional, but in your case you are specifying it, so remove the brackets.

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [January 29, 2020, 11:35am UTC](https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702/3 "2020-01-29T11:35:17Z")

</div>

I tried without any port number and just the listener address but that doesn’t seem to work either !  
Is there an example on how listener should be connected?  
Thanks

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [January 29, 2020, 2:12pm UTC](https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702/4 "2020-01-29T14:12:05Z")

</div>

I am getting following error by just entering the listener address :

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9d3b792e90bc930c4b25bdc0c4e77f634f2ead57.png)

Thanks !

---

<div class="post-metadata">

**Author:** ![david.booth1](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@david.booth1](https://forum.inductiveautomation.com/u/david.booth1)\
**Post date:** [February 11, 2021, 6:02am UTC](https://forum.inductiveautomation.com/t/cannot-connect-to-database/31702/5 "2021-02-11T06:02:52Z")

</div>

> [@kaushik.shah](#):
>
> jdbc:sqlserver://Listener[: Port]

I am sure you have sorted this by now.  
I got it to work using  
jdbc:sqlserver://Listener\InstanceName

Hope that helps others looking for it
