Error: "Connection failed: SQLState: '08001' occurs when creating an ODBC connection on Microsoft SQL 2008 r 2 - sql

I have two sql server installed in same server.
SQL server 2012 express and SQL server 2008 r2.
After we moved to new office, we are not able to connect 2008 server but still able to connect 2012.
I have checked and confirmed that TCP/IP is enabled and the port is 1433 for both server.
SQL browser is also enabled
That is no firewall for blocking inbound and outbound from server, however I can't disable end user firewall as the option is being grey out by company IT.
ABC\SQLexpress2012 - working
ABC\SQL2008 - doesn't not working
We managed to login Sql management studio in the machine itself. But both NT authentication and SQL authentication are not working in end user PC.
Any ideas from the experts here ?

I discovered my server had been changed to IPV6, and client was not set up for IPV6. Disabling IPV6 to force IPV4 aliviated the problem.

Change your SQL Server 2008 port
try this one
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port

Related

Access MS SQL server remotely

I've been busy going through many of the question asked under the same topic but none of them had solved my problem.
I have MS SQL 2012 standard (trial) is installed on my local PC. Also I have a MS SQL std. server 2005 is installed on a web server (Windows Server 2003) in different domain. Normally I can RDP the web server using the static IP address given by the Infrastructure provider.
Now I wanted to access my MS SQL server installed on the web server using the MS SQL management studio installed on my local PC. but I'm receiving the following error when I try to connect. I tried with the same IP which I used to log in to the server using RDP as the server name.
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) (.Net SqlClient Data Provider)
I followed almost everything in this KB. But the windows firewall is disabled on the web server. while I'm waiting for Infrastructure provider to confirm there is no other network level firewall denies access for port:1433, I would like to know are there anything else that I'm missing here?
Problem has been resolved after forwarding the port TCP: 1433 on the router firewall.

SQL Server Express - Connect from remote machine

I have two Win 7 64 bit machines.
On the first one I have installed SQL Server 2008 R2 Express and have no trouble connecting via Management Studio with Windows Auth and also via SQL Auth with a user I set up on the database.
On the second machine I am trying to connect to the database on machine 1 using Management Studio. I'm trying SQL Auth. I therefore obviously also can't connect to it via connection string in my .NET Code
I can ping the first machine from the second.
Things I have tried include the following:
On the machine the database is installed make sure the firewall is allowing connection on Port 1433
Made sure SQL Server service is running
Made sure SQL Server Browser service is running
Created an exception for sqlbrowser.exe in the firewall
Enabled TCP/IP Protocol through SQL Configuration manager
Allowed Remote connections in SQL Server Management Studio
The error I get is:
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
This is the connection string I use in code
Data Source=xxx.xxx.xxx.xxx\sqlexpress;Initial Catalog=dbName;User Id=myUser;Password=myPassword;
This can be caused by a number of reasons but I'm glad my suggestion about checking firewall ports (rather than just allowing a one-way exception for SQL Browser) led you to the answer: the firewall wasn't allowing the correct port # through.
If i remember correctly SQL Server disables remote connections by default.
Please check whether remote connections are enabled and enable them if not:
RMB on Server in Management Studio Object Explorer -> Properties -> Connections -> Allow remote connections...

Cannot connect to SQL server - client side issue

I might be the million'th person posting about this, but others' solutions haven't helped me. I have a database on Microsoft SQL Azure. I an trying to connect to it using the Visual Studio 2010's "Connect to Database" Tool.
From my Windows 7 machine, I can connect to it very easily. But from my Windows Server 2008R2 machine i am getting the classic error -
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)
All the posts around the web seem to be focussing on the problems on the server side, no one cares if the client goes rogue. :(
Thanks for the replies.
I have seen similar problems with VS2010 DB Tool and Windows Server so I would not suggest try using SSMS 2008 R2 (must be R2). Once you have download SSMS 2008 R2 and configured properly to work on Windows Server it sure will work. In most of the case you really need to open SSMS settings to get it workon on Windows Server.
Next a few points to check:
Verify that the telnet is working from your Windows Server Machine:
c:>telnet _your_sqlazure_database_name.database.windows.net 1433
Disable your real time security and the try again
Finally following the link to keep applying settings in your Windows Server and SSMS which are applicable and I am sure it will work:
http://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/
One issue is that you need to connect via tcp, not named pipes (per your error message).
Are both servers behind the same firewall (e.g. the same external IP address)? The SQL Azure firewall needs to be configured to allow access from remote IP addresses.

Enabling remote connection to SQL Server 2008 Express on Windows Server 2008

I am trying to connect to the SQL Server 2008 Express from my local machine but for some reasons I am not able to connect to the server.
sqlserver.exe is allowed in the firewall
TCP protocol is enabled
sqlexpress is running
allowing remote connections to the server
When I disabled the firewall for the public connections it is working fine
Any other suggestions please
from what I read I think the problem is the firewall
I came a cross an answer I didn't try it, it could be helpful
the solution was found here

sql server 2000 error, error trying to connect to sql server 2005

i am connecting to sql server 2000 on a remote computer with a dotnet application, but when i try to open the connection it gives the following error:
When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections
What is this?
It means that the remote SQL server is configured to not allow remote connections.
From this forum discussion:
Make sure SQL SERVER is up and the instance you try to connect is running.
Your system Firewall should not block SQL Server port.
Go to Computer Management >> Service and Application >> SQL Server 2005 Configuration >> Network Configuration Enable TCP/IP protocol. Make sure that SQL SERVER port is by Default 1433.
Now follow this KB Article of MSDN depending on your server.
Are you sure you're connecting to a sql server 2000 instance?
Possibly it's been upgraded to 2005?
Try following the procedure here: http://support.microsoft.com/kb/914277 to allow remote connections.
By default, as a security feature, SQL Server 2005 does not enable connections from other machines on the network.
Verify that your SQL Server and its databases are suitably secured (for example, have proper user accounts and passwords, etc.). Once you are satisfied, go to Start, Program Files, Microsoft SQL Server 2005, Configuration Tools, SQL Server Surface Area Configuration. Look for Database Engine, Remote Connections and change the setting to allow remote connections.