# Connecting to Database on a different server

**URL:** <https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777>\
**Category:** General Discussion\
**Created:** [January 29, 2018, 2:21pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777 "2018-01-29T14:21:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [January 29, 2018, 2:21pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777/1 "2018-01-29T14:21:51Z")

</div>

Hello All:  
For my project, I’m trying to connect to two MSSQL Db on different server using windows authentication . One is local server (on which gateway is running). Another Data base is on a different machine. I’m able to connect to the one on local server, but not to the data base on different machine. I’m getting the error “Login Failed for the user”. Please let me know if I am missing anything

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [January 29, 2018, 2:44pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777/2 "2018-01-29T14:44:18Z")

</div>

Connecting to an MS DB using the Active Directory has always been a nightmare to me.

It’s a lot easier to just create a local user on the database (so you can connect using “SQL Server Authentication”), and then use that username and password to connect to the database.

If you don’t have SQL Server Authentication enabled now, you’ll have to restart the database service once, but it’s a lot easier afterwards.

---

<div class="post-metadata">

**Author:** ![oscar.salcedo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/oscar.salcedo/32/11019_2.png) [@oscar.salcedo](https://forum.inductiveautomation.com/u/oscar.salcedo)\
**Post date:** [January 29, 2018, 2:59pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777/3 "2018-01-29T14:59:14Z")

</div>

How are you passing down the username in the Ignition DB configuration entry? For me it works by using the FQDN, like this:  
domainname\user

As long as the database has that domain user with access to the database, you should be able to connect.

Oscar.

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [January 29, 2018, 3:01pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777/4 "2018-01-29T15:01:01Z")

</div>

Hello Oscar.  
I am using domainname\user in the user section. It’s working for the server on the local machine, but not on the different machine

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [January 29, 2018, 3:51pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777/5 "2018-01-29T15:51:20Z")

</div>

Now I am able to connect to master database in the remote server. But when I try to connect to a custom created database, I’m getting this following error  
“Cannot open database “HUAOPCDB” requested by the login. The login failed”

Any ideas?

Thanks,  
Shwetha.

---

<div class="post-metadata">

**Author:** ![shwethag](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@shwethag](https://forum.inductiveautomation.com/u/shwethag)\
**Post date:** [January 29, 2018, 4:36pm UTC](https://forum.inductiveautomation.com/t/connecting-to-database-on-a-different-server/16777/6 "2018-01-29T16:36:46Z")

</div>

Solved. The guest account was disabled on the database
