Leave a comment

Could not open a connection to SQL Server Error-40|Error: 1326

The Article regarding the SQL Server Error-40|Error: 1326 Could not open a connection to SQL Server Instance Remotely. In this topic I will describe why the SQL Server Instance unable to connect and What configurations required to resolve the SQL Server Issue.

I am working as a SQL server Administrator and I have to provide access to the user for their .net Applications/Java Application, “Cannot connect to SQL Server” lots of user facing Issue with the error (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326) ,


SQLError:

TITLE: Connect to Server

—————————

Cannot connect to SQL2005 SQL-2008 SQL-2012 SQL-2016.

——————————

ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=1326&LinkId=20476

The user name or password is incorrect

BUTTONS:

OK

Solutions and Troubleshooting Steps Below:

1. Try to find SQL Server Configurations Manager on your Windows System All Programs or type “sql” in your Windows Search bar.

SQL

2. Expand the “SQL Server Network Configurations ” See Image below:

SQL

3. Next to select “TCP/IP ==> Properties” and Enabled it from drop down list See Image below:

SQL

4. Next go to the Tab “IP Addresses” and Port 1433 in IPv4 Section.

SQL

5. Open SQL Server Management Studio or type the short command to open it “SSMC” see the example below:SQL

6. Once you have opened the SQL Server management Studio => Connect the SQL server Instance by Default it comes with Basic Authentication => Right Click on the Instance connected and Click on Properties:

 

7. Next Click on Security Tab => and Enable SQL Server Windows and SQL SQLServer Authentication Mode.SQL

8. Next Click on Connections Tab => To Allow Remote Connections to this Server” If this is not checked you can access the SQL server Remotely.

SQL

9. Check the SQL Server Instance Services and using “services.msc” Start or set “Automatic” see the example image below:

SQL

10. Configure Windows Firewall to Allow SQL Server Port “1433” for Remote Access.

Go to => Control Panel\All Control Panel Items\Windows Firewall Or directly run the command “firewall.cpl” it will open Firewall Management see below Image:SQL

11. Next to click on Advance Settings ==> Inbound Firewall Setting refer the image below:

SQL

12. Next Click on “Inbound Rules” and click “New Rule” Select “TCP Port” and click on Next:
Example here:

SQL

13. Next specify the port “1433” to Allow the Connection and continue.

SQL

14. Select the option “Allow The Connection” and Click Next:
Example:SQL

15. Next Give the name of Rule you want to create I used “SQL Server Remote Access ” and continue to Finish.

SQL

Next Client Machine Firewall Configuration.
==> Also check Client Machine Firewall for the incoming port 1433 from where you are trying to connect.

1. Utility: SQL Server Management Studio or your application code where you can access the SQL server Access.
2. Utility: Telnet Client is as windows client tool to test the open port connectivity. Open your Commad Promt type “telnet host IP 1433” you can also your Server host computer.

Testing the SQL Server Access:

Example:

C:\Users\Administrator>telnet 192.168.1.7 1433

Connecting To 192.168.1.7..

Success!

After these I was also Facing issue and Troubleshooting I did below:

Q. Still facing the SQL Server “Could not open a connection to SQL Server ?”

After few months accidentally, I face such issue on a windows 7 Computer, even Clean Installations on that Computer I was getting issue, And other Client Computers machines able to connect the SQL server and one client machine was not able to connect SQL server.

2 . Solutions :create a new User for SQL server Database and tried it to access now it works for me !

Leave a Reply

Your email address will not be published. Required fields are marked *