DEV Community

FakeStandard
FakeStandard

Posted on

Can't Connect to SQL Server? Check If TCP/IP and Firewall Are Enabled

I tried to log in to SQL Server but got a following error

A connection was successfully established with the server, but then an error occurred during the login process (Error 233)

What causes this?

1️⃣ Review the Error Details

First, I checked the technical details of the error

Server Name: .
Error Number: 233
Severity: 20
State: 0
Enter fullscreen mode Exit fullscreen mode

Error number 233 usually occurs the connection is successful, but rejects the login. So, we need to check if TCP/IP is enabled.

2️⃣ Enforce to Connect the TCP/IP

Change the serve name to tcp:127.0.0.1 without . or localhost.

If you still fail to log in and got the following error, proceed to enabled TCP/IP

Error Number: 1225
Severity: 20
State: 0
Enter fullscreen mode Exit fullscreen mode

3️⃣ Check if TCP/IP is Enabled

  1. Open SQL Server Configuration Manager
  2. Expand SQL Server Network Configuration, then select Protocols for MSSQLSERVER or SQLEXPRESS
  3. Enabled TCP/IP and Named Pipes
  4. Restart SQL Server and try logging in again

4️⃣ Enable Firewall Rule for Port 1433

Your firewall might be blocking SQL Server's default port 1433. To fix this, enable the firewall rule using the command line.

netsh advfirewall firewall add rule name="SQL Server 1433" dir=in action=allow protocol=TCP localport=1433
Enter fullscreen mode Exit fullscreen mode

Easy fix. Job done☑️


Thanks for reading!

If you like this article, please don't hesitate to click the heart button ❤️
or follow my GitHub I'd appreciate it.

Top comments (0)