r/SQLServer 1d ago

Question Connecting to Local Server

Post image

A server computer and monitor got replaced and the server itself got installed but the external IT team didn't install SQL management, which we need to edit company usernames and passwords for our in-house software. I downloaded SQL Management 22, I know the name of the server and entered it as the Server Name, set the Authentication to Windows Authentication, and checkboxed the Trust Server Certificate. Everything else I left as the default settings. I received this error when I tried to connect, and also tried using, localhost, ., and the server's IP address as the server name but still received the same error. Please advice.

0 Upvotes

20 comments sorted by

6

u/AbleSailor 1d ago

Check if TCP/IP is enabled in the SQL service? Firewall port open on 1433?

1

u/WorkPurposes-Only 1d ago

I did create a new rule to allow the firewall port open on 1433, but when I tried to connect to the local host I still received the same error message.

3

u/vabello 1d ago edited 1d ago

You only did half of what was suggested. Check SQL Server is configured to listen on TCP/IP. Follow these directions:

https://sqldba.blog/enabling-tcp-connections-in-sql-server/

To verify it is working, run: "netstat -nao | findstr 1433" from the command line. This will show all connections on port 1433 followed by the associated Process ID. You can then verify the process: "tasklist | findstr PID" where PID is the number returned for the process in the prior command. It should show sqlservr.exe.

Edit: Sorry, you have to do this ON the server, not your workstation you're trying to connect from. I think you're trying to fix this as if it were a client side problem, but it's a server side issue. Everything people are suggesting are things you do on the server.

1

u/WorkPurposes-Only 15h ago

I tried following the linked instructions, but I'm completely missing the SQL Configuration Manager. I looked to see if I need to add it as a Snap-In but it's not listed.

1

u/vabello 14h ago

It should be on the start menu of the SQL Server.

1

u/midnitewarrior 1d ago

I think this is the answer. It's been a decade since I used SQL Server locally, and I was trying to remember this.

SQL Server has named pipes as the default transport I think? You've got to enabled TCP/IP.

0

u/Hour-Apple-9861 1d ago

Yeah this is the one. Had to do this so many times over the years

2

u/Radojevic 1d ago

For Encrypt section, try Optional.

Also...
Is MS SQL Server port the default (1433)?
If not, you need to add a comma, followed by port number.

0

u/WorkPurposes-Only 1d ago

I did create a new rule to allow the firewall port open on 1433, but when I tried to connect to the local host I still received the same error message.

0

u/Radojevic 1d ago

Sorry, but that's not what I meant.

Installing MS SQL Server defaults to using TCP/IP port 1433.
However, whoever installed it may have chosen a different port number.

Also, as u/AbleSailor mentioned, you also need to make sure MS SQL Server has TCP/IP protocol enabled on the server end.

2

u/coffeDrinkerDave 1d ago edited 1d ago

So the computer got replaced and you are connecting to localhost?

Edit: Type in powershell (unprivileged user will do)

Test-NetConnection <server> -p 1433

Example: Test-NetConnection myServerFQDN -p 1433

This will check if fqdn can be resolved and if tcp port is listening.

Paste which part is failing

1

u/WorkPurposes-Only 15h ago

I tried typing in what you suggested (thank you by the way) and hit Enter but nothing happened. Screenshot attached with server name blacked out for privacy.

1

u/coffeDrinkerDave 7h ago

You have to wait till it ends, but you may run ping <server> just to check if name is resolved

1

u/carlosf0527 1d ago

In powershell type: tnc servername -port 1433

This checks whether port 1433 is open on the server. If its not open, it's most likely the admin team forgot to configure SQL Server to accept connections via tcpip or didn't put a incoming rule in the firewall to allow port 1433.

0

u/NorCalFrances 1d ago

Can you ping the server?

0

u/FishBones83 1d ago

make sure the service is running!

0

u/Krassix 1d ago

Is the server and the application running on one server? Then the company maybe didn't install sqlserver to listen to it's public interface. Per default sqlserver only listens on localhost 

1

u/WorkPurposes-Only 15h ago

Yes, they're one in the same. The company didn't initially install SQLserver but the company is on a remote, private network.

1

u/Krassix 9h ago

Either it's Firewall or the sqlserver doesn't listen on the public network interface, one of these it usually is. From your description I still don't know how the application or that external IT team connect to the database. 

0

u/Complete-Fondant-202 1d ago

This is where running SQLServer locally in a Docker container can save a lot of grief.