# Error connecting to SQL Server Express 2008 R2

**URL:** <https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349>\
**Category:** Ignition\
**Created:** [November 16, 2010, 8:27pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349 "2010-11-16T20:27:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [November 16, 2010, 8:27pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/1 "2010-11-16T20:27:13Z")

</div>

I get the following error:  
Error:  
Cannot create PoolableConnectionFactory (The connection to the host localhost, named instance SQLEXPRESS has failed. Error: “java.net.SocketTimeoutException: Receive timed out”. Verify the server and instance names, check that no firewall is blocking UDP traffic to port 1434, and for SQL Server 2005 or later verify that the SQL Server Browser Service is running on the host.)

I left the default instance name of SQLEXPRESS. I am using jdbc:sqlserver://localhost\SQLEXPRESS as the Connect URL. I am using the default “sa” account for the login with the password that I created.

I have enabled the TCP/IP protocol, started the SQL Server Browser service, and made sure that “Allow Remote Connections” is checked. I have Windows Firewall turned off.

It seems that I have everything set up correctly according to the information that I could find but it is not working so I must have missed something.

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [November 16, 2010, 8:52pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/2 "2010-11-16T20:52:01Z")

</div>

Oh, and I also made sure that mixed mode authentication is on and that I can log into the database using the Management Studio with the “sa” account.

---

<div class="post-metadata">

**Author:** ![ISDProj](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@ISDProj](https://forum.inductiveautomation.com/u/ISDProj)\
**Post date:** [November 16, 2010, 9:01pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/3 "2010-11-16T21:01:39Z")

</div>

Try moving the instance name to the “extra connection properties”  
e.g.  
instanceName=SQLEXPRESS

I seem to remember having to do that when I first started on a development machine wth SQL express.

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [November 16, 2010, 9:28pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/4 "2010-11-16T21:28:12Z")

</div>

I just gave that a try but I get the same result.

---

<div class="post-metadata">

**Author:** ![ISDProj](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@ISDProj](https://forum.inductiveautomation.com/u/ISDProj)\
**Post date:** [November 16, 2010, 10:07pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/5 "2010-11-16T22:07:21Z")

</div>

Just out of Curiosity, the PC you are running this on is connected to a network while you are trying to connect using “localhost” ?

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [November 16, 2010, 10:10pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/6 "2010-11-16T22:10:37Z")

</div>

It is just connected to my home wireless at the moment for internet.

---

<div class="post-metadata">

**Author:** ![ISDProj](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@ISDProj](https://forum.inductiveautomation.com/u/ISDProj)\
**Post date:** [November 16, 2010, 10:16pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/7 "2010-11-16T22:16:18Z")

</div>

Also check that “Shared Memory”, “TCP/IP”, and “Named Pipes” are enabled… at least TCP/IP needs to be anyway. 🙂

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [November 16, 2010, 10:57pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/8 "2010-11-16T22:57:01Z")

</div>

You might try running “netstat -a” from the command line and verify that UDP 1434 is listening. Your first method of specifying the instance was correct, so either TCP/IP isn’t fully enabled, or something is blocking it.

Regards,

---

<div class="post-metadata">

**Author:** ![ISDProj](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@ISDProj](https://forum.inductiveautomation.com/u/ISDProj)\
**Post date:** [November 16, 2010, 11:24pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/9 "2010-11-16T23:24:26Z")

</div>

Alex, take note that with the output from netstat -a the UDP port may be listed as ms-sql-m rather than 1434

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [November 16, 2010, 11:38pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/10 "2010-11-16T23:38:14Z")

</div>

All except “Named Pipes” were enabled. I enabled that one and re-started the SQL service but no change. The only protocol not enabled now is “VIA”.

The “netstat -a” produces a line “UDP [::]:1434 _:_” That is the only reference I see for UDP at that port #.

---

<div class="post-metadata">

**Author:** ![DarrenAsh](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@DarrenAsh](https://forum.inductiveautomation.com/u/DarrenAsh)\
**Post date:** [November 17, 2010, 8:22pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/11 "2010-11-17T20:22:49Z")

</div>

Is the SQL Server Browser service running?

Darren

---

<div class="post-metadata">

**Author:** ![alex.ferrell](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@alex.ferrell](https://forum.inductiveautomation.com/u/alex.ferrell)\
**Post date:** [November 17, 2010, 9:14pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/12 "2010-11-17T21:14:29Z")

</div>

Yes, the SQL Server Browser service is running.

---

<div class="post-metadata">

**Author:** ![chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chris](https://forum.inductiveautomation.com/u/chris)\
**Post date:** [May 24, 2011, 4:08pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/13 "2011-05-24T16:08:19Z")

</div>

I recently had this problem using SQL Server 2008 R2. Besides above: ensuring the firewall ports are open (both hardware and software firewalls), SQL Server Browser is running, SQL Server Instance allows Remote Connections, and SQL Server TCP/IP is enabled, I had to do the following to get the remote connection to work:

- In the SQL Server TCP/IP Properties, explicitly set the TCP Port to 1433 and TCP Dynamic Ports to blank under IPAll section
- In Ignition Database Connection Properties Connect URL, explicitly supply the port number. ie. “jdbc:sqlserver://\<InstanceName\>:1433”

Hope this helps.

---

<div class="post-metadata">

**Author:** ![toasty](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@toasty](https://forum.inductiveautomation.com/u/toasty)\
**Post date:** [May 25, 2011, 5:05am UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/14 "2011-05-25T05:05:32Z")

</div>

I have a test machine with SQL 2008 R2. Instead of using localhost, put the computer name.

Example: jdbc:sqlserver://TRAINING3\SQLEXPRESS  
TRAINING3 is the computer name  
SQLEXPRESS instance name

---

<div class="post-metadata">

**Author:** ![nskoog](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nskoog](https://forum.inductiveautomation.com/u/nskoog)\
**Post date:** [December 15, 2015, 9:27pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/15 "2015-12-15T21:27:20Z")

</div>

[quote=“chris”]I recently had this problem using SQL Server 2008 R2. Besides above: ensuring the firewall ports are open (both hardware and software firewalls), SQL Server Browser is running, SQL Server Instance allows Remote Connections, and SQL Server TCP/IP is enabled, I had to do the following to get the remote connection to work:

- In the SQL Server TCP/IP Properties, explicitly set the TCP Port to 1433 and TCP Dynamic Ports to blank under IPAll section
- In Ignition Database Connection Properties Connect URL, explicitly supply the port number. ie. “jdbc:sqlserver://\<InstanceName\>:1433”

Hope this helps.[/quote]

This solved my problems after getting a “port 49565 has failed” timeout. Deleted port 49565 from the TCP Dynamic Ports and added port 1433 to the TCP Port and got the “Valid” status. We were connecting to SQL Server Express 2014 that was installed on top of SQL Server Express 2008.

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [March 1, 2017, 5:42pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/16 "2017-03-01T17:42:20Z")

</div>

alex.ferrell, is this still something you need help with?

---

<div class="post-metadata">

**Author:** ![junhc](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@junhc](https://forum.inductiveautomation.com/u/junhc)\
**Post date:** [December 3, 2019, 2:58am UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/17 "2019-12-03T02:58:08Z")

</div>

I also waste my time with this problem. I add not only the port 1434, 1433 but also SQL Server Browser Run in configuration manager.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 4, 2020, 5:28am UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/18 "2020-09-04T05:28:45Z")

</div>

FWIW, I came up against an error similar to this, and the issue was that the IP addresses within the TCP/IP properties were set to Disabled. I enabled the localhost one (and the others just in case) and it started working.

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

---

<div class="post-metadata">

**Author:** ![srb](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@srb](https://forum.inductiveautomation.com/u/srb)\
**Post date:** [June 29, 2021, 8:13pm UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/19 "2021-06-29T20:13:51Z")

</div>

To connect to a remote server, I had to specify the default port 1433 at the end for it to work:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bccf6c4165443e594485890e46ed04aaad470a50.png)

---

<div class="post-metadata">

**Author:** ![nnaik](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@nnaik](https://forum.inductiveautomation.com/u/nnaik)\
**Post date:** [June 14, 2023, 9:55am UTC](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349/20 "2023-06-14T09:55:47Z")

</div>

Solution, Thanks

[Next page](https://forum.inductiveautomation.com/t/error-connecting-to-sql-server-express-2008-r2/2349.md?page=2)
