Error connecting to all of my SQL servers - sql-server-2005

I suddenly started getting this error when trying to connect to any of my sql servers (25+) from SSMS on Windows XP. When I left work yesterday everything was working fine, came in this morning, and I started getting this. Tried rebooting my pc but that obviously didn't fix it. My co-workers can all connect just fine. Searched for a solution but everything I found was regarding encryption in regards to .NET applications. Not sure how to apply that to SSMS.
alt text http://picasaweb.google.com/lh/photo/-l9VrFuYXk-A80NzZ1kzng?feat=directlink
For some reason the image won't work so the error is this:
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (Microsoft SQL Server)

The question seems to have been answered, but I wanted to chime in. For some providers, such as SQL Server, there is a parameter in connection string which lets you connect to server encrypted even if certificate is unknown: "TrustServerCertificate=True", so if you include that in a connection string, you will connect and work encrypted, and will not have to run connection non-encrypted.

Try this...
Its gotta be a client issue if you lost connection to all your remote servers and your coworkers are fine. You probably got "clicky" and changed some settings inadvertantly.
Open your client network utility (mine is here: C:\WINDOWS\system32\cliconfg.exe).
Under the General Tab, check out the disabled protocols. They should all have "force protocol encryption" unchecked. If this is checked for any of those values, your local SSMS is probably trying to force an encrypted connection and failing.
Report back if this doesn't work, and I'll poke around a bit more.

When connecting using MS SQL Server Management Studio in the connect window go to Options->Connection Properties and check checkbox Trust server certificate

You connect to your SQL Servers requesting encrypted connections and you don't trust the certificate(s) used by those servers. Why that happens depends on a myriad or reasons.
Do your servers use self-signed certificates or PKI issued certificates?
Who is the PKI authorithy that issued your certificates? Is it a corporate certificate service?
Does your computer trust the PKI root authority?
If you don't know the answers to this, you must contact your network and security administrators. Simply disabling protocl enforcing requirement from your client may be against corporate policy, or the servers may enforce SSL anyway disregarding your local setting.
These are all questions you should ask your own environment admins, not public forums. You should try to solve the issue, not hack your way arround it and end up with a non-compliant machine.

From this link:
Disable client-side Force Encryption
on the server. On the machine that
runs the SQL Server instance, open up
the SQL Server Configuration Manager,
right-click SQL Native Client
Configuration, and set Force Protocol
Encryption to No. Then try connecting
locally.
http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

I got this error, I tried to connect a remote server SQL (SaaS) in MS Cloud
I added a new firewall rule in Azure portal with my client IP that solved my issue

Open Command Prompt: press Windows Key+ R then type cmd and run
Enter this:
runas /user:[YourDomainName]\[YourActiveDirectoryUserName] /netonly cmd
Enter your active directory password and press enter
In New Command Window enter your SSMS.exe Path with double cotation like:
"C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe"
Then login with windows athentication

Related

SQL Connection: Server Not Found or Access Denied when Connecting from Client PC

I'm having an issue with an SQL database connection from client pc to the server pc. FYI, I am not an SQL-wiz.
I'm using a cashier program called (الأمين), and there is not enough support for this problem. When I try to connect to the main server through the client pc, I receive the following error:
[DBNETLIB] [ConnectionOpen (Connect().]SQL Server does not exist or access denied
I already tried the following fixes:
Windows firewall inbound and outbound rules for ports 1433 and 1434.
Client Utility Management, I enabled the TCP/IP and kept the named pipes disabled. I added the appropriate server name and I added the IP of the server as alias. (This is on the Client PC)
I enabled the TCP/IP on the SQL server configuration and added 1433 under IPAll and IP1.
I made sure that the password and user names being logged in with were correct from the client pc.
I made sure "Allow Remote Connection" was turned on in the server settings.
I could've also tried some more fixes already but can't recall them right now.
Please, any help would be appreciated. I just need the client PC to connect to the server PC. The problem could be from the cashier program itself, but it works for other users of the same software. There isn't enough support for the program so I have to fix it myself. I am convinced there is a simple solution that I just don't see.
Thank you plenty in advance!
I am using version 18.8 SQL Server Management Studio, and am on windows 10.
I figured it out!
The problem was with the login of SQL.
I logged in using "sa" the user made with the SQL creation and it works now.
Thank you!

Cannot connect to remote SQL server

A client of mine gave me a server name which is fully qualified [servername].somedomain.net
to try to connect to their SQL Server instance over VPN.
So I tried, using the username and password they gave me. No luck. I can ping it but cannot connect, I get the error that the username and password is incorrect.
So I log onto the actual server, verify that my login is in security and has rights and it appears there. Workgroup\mylogin and it appears that workgroup\ actually is the same as somedomain.net\mylogin. Because when I try to add somedomain.net\mylogin, it resorts to saying that it's already added which is workgroup\mylogin.
Not sure what else to check here. I gave myself sysadmin role in SQL Server. I can ping the server's IP.
I looked at how they are authenticating me and they have my user in SQL Server set up to use Windows Auth. Well, the error I get is that it cannot trust cross domain when trying to use windows auth when I try to connect locally here in my management studio. I'm connected tot their VPN so what could be the problem?
They're not available right now to try to troubleshoot it and I'm just curious what else I might try to try and resolve this on my own if I can.
Basically, when you failed to connect to your SQL Server, the issue could be:
Network issue,
SQL Server configuration issue.
Firewall issue
Client driver issue
Application configuration issue.
Authentication and logon issue.
Step 1: Network issue
You might be able to make local connection without a working network, but that's a special case. For remote connection, a stable network is required. The first thing to trouble shoot SQL connectivity issues is to make sure the network we rely on is workable and stable. Please run the following commands:
ping -a (use -4 and -6 for IPv4 and IPv6 specifically)
ping -a
nslookup (type your local and remote machine name and IP address multiple times)
Be careful to see any mismatch on the returned results. If you are not able to ping your target machine, it has high chance that either the network is broken or the target machine is not running. It's possible the target machine is behind a firewall and the firewall blocks the packets sent by ping, though. Windows firewall does not block ping (ECHO) packet by default. The correctness of DNS configuration on the network is vital to SQL connection. Wrong DNS entry could cause of all sorts of connectivity issue later. See this link for example, "Cannot Generate SSPI Context" error message, Poisoned DNS.
Step 2: SQL Server configuration issue
You need to make sure the target SQL Server is running and is listening on appropriate protocols. You can use SQL Server Configuration Manager (SCM) to enable protocols on the server machine. SQL Server supports Shared Memory, Named Pipes, and TCP protocols (and VIA which needs special hardware and is rarely used). For remote connection, NP and/or TCP protocols must be enabled. Once you enabled protocols in SCM, please make sure restart the SQL Server.
You can open errorlog file to see if the server is successfully listening on any of the protocol. The location of errorlog file is usually under:
%ProgramFile%Microsoft SQL Server/MSSQLxx.xxx/MSSQL/Log
If the target SQL instance is a named instance, you also need to make sure SQL Browser is running on the target machine. If you are not able to access the remote SQL Server, please ask your admin to make sure all these happen.
Step 3: Firewall issue
A firewall on the SQL Server machine (or anywhere between client and server) could block SQL connection request. An easy way to isolate if this is a firewall issue is to turn off firewall for a short time if you can. Long term solution is to put exception for SQL Server and SQL Browser.
For NP protocol, please make sure file sharing is in firewall exception list. Both file sharing and NP use SMB protocol underneath.
For TCP protocol, you need put the TCP port on which the SQL Server listens on into exception.
For SQL Browser, please put UDP port 1434 into exception.
Meanwhile, you can put sqlservr.exe and sqlbrowser.exe into exception as well, but this is not recommended. IPSec between machines that we are not trusted could also block some packets. Note that firewall should never be an issue for local connections.
Step 4: Client driver issue
At this stage, you can test your connection using some tools. The tests need to be done on client machine for sure.
First try:
telnet
You should be able to telnet to the SQL server TCP port if TCP is enabled. Otherwise, go back to check steps 1-3. Then, use OSQL, SQLCMD, and SQL Management Studio to test sql connections. If you don't have those tools, please download SQL Express from Microsoft and you can get those tools for free.
OSQL (the one shipped with SQL Server 2000) uses MDAC.
OSQL (the one shipped with SQL Server 2005 & 2008) uses SNAC ODBC.
SQLCMD (shipped with SQL Server 2005 & 2008) uses SNAC OLEDB.
SQL Management Studio (shipped with SQL Server 2005 & 2008) uses SQLClient.
Possilbe command use be:
osql -E -SYour_target_machine\Your_instance for Windows Auth
osql -Uyour_user -SYour_target_machine\Your_instance for SQL Auth
SQLCMD also applies here. In addition, you can use “-Stcp:Your_target_machine, Tcp_port” for TCP, “-Snp:Your_target_machine\Your_instance” for NP, and “-Slpc:Your_target_machine\Your_instance” for Shared Memory. You would know if it fails for all protocols or just some specific procotols.
At this stage, you should not see general error message such as error 26 and error 40 anymore. If you are using NP and you still see error 40 (Named Pipes Provider: Could not open a connection to SQL Server), please try the following steps:
a) Open a file share on your server machine.
b) Run “net view \your_target_machine” and “net use \your_target_machine\your_share” (You can try Map Network Drive from Windows Explorer as well)
If you get failure in b), it's very likely you have OS/Network configuration issue, which is not SQL Server specific. Please search on internet to resolve this issue first.
You can try connection using both Windows Authentication and SQL Authentication. If the tests with all tools failed, there is a good chance that steps 1-3 were not set correctly, unless the failure is logon-related then you can look at step 6.
If you succeeds with some of the tools, but fails with other tools, it's probably a driver issue. You can post a question on our forum and give us the details.
You can also use “\windows\system32\odbcad32.exe” (which ships with Windows) to test connection by adding new DSN for various drivers, but that's for ODBC only.
Step 5: Application issue
If you succeed with steps 1-4 but still see failure in your application, it's likely a configuration issue in your application. Think about couple of possible issues here.
a) Is your application running under the same account with the account you did tests in step 4? If not, you might want to try testing in step 4 under that account or change to a workable service account for your application if possible.
b) Which SQL driver does your app use?
c) What's your connection string? Is the connection string compatible to your driver? Please check http://www.connectionstrings.com/ for reference.
Step 6: Authentication and logon issue
This is probably the most difficult part for sql connectivity issues. It's often related to the configuration on your network, your OS and your SQL Server database. There is no simple solution for this, and we have to solve it case by case. There are already several blogs in sql_protocols talking about some special cases and you can check them see if any of them applies to your case. Apart from that, things to keep in mind:
a) If you use SQL auth, mixed authentication must be enabled. Check this page for reference http://msdn.microsoft.com/en-us/library/ms188670.aspx
b) Make sure your login account has access permission on the database you used during login ("Initial Catalog" in OLEDB).
c) Check the eventlog on your system see if there is more information
Reference: http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx
Sorry for this wall of text, i hope that something from here can help you solve your issue!
Regards.
If you want to access that server you are going to need a domain account from that domain or use SQL authentication. I would recommend just using SQL authentication - it's a lot more straight forward - if they allow it.
I had the same problem, other machines could connect to sql server but one computer was not connecting and displaying the error "a network related or instance specific error...", the problem was solved when I changed the network protocol in the login window of SSMS, in advanced options from TCP/IP to Named Pipes. Please see the below screenshots.
Please note that you should be on the same domain, and your credentials should be valid on the server.

Connecting to my remote SqlServer database

Im currently making a wpf Windows Application, and it withdraws data from a database, so it is needed that I setup a connection to my remote servers SQL Server Database. Now i am getting a couple errors. When I first of all try to connect to my remote servers Sql Server using management studio, just to test if I could actually make a connection, I get the following error.
A connection was successfully established with the server, but then an error occured during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)
(Microsoft SQL Server, Error: 233)
And ovcourse, I did try my best to do my research, and I found out a few things talking about allowing the SqlBrowser in firewall properties, done that...
allowing a connection to port 1433 and port 1434 through windows firewall, done that both.
Is there something Im missing or not doing?
Also it says "a connection was succcessfully established with the server" which means that It is able to connect, but something is going wrong somewhere. Also where it says "error occured during login process" could it simply mean I entered the wrong credentials?
I mean, when installing the SQLExpress I chose Windows Authentication so I never really got a username and password, So i just used the username and password for the Administrator account I use to connect to my server itself. Dont know It could have something to maybe just do with my login.
Could anyone please point me in the right direction as to why Im getting that error, even though I have enabled the TCP Connections and allowed SqlBrowser.
Any help would be greatly appreciated.
Thanks.
This is a bad certificate-related error, probably caused by different operating systems/environmental differences. If this is for testing purposes I'd disable the certificate, or you can configure it here (which is probably a good idea if you're creating a real application and not just playing around with it).
Please run the sql service and agent service by creating new id and start the service with that like ea admin or any other.
The port error will continue to show even if you fix the port ,check telnet configuration and enabled/open port via it.
I had similar problems so i created a virtual server installed sql server2008 r2 and then started it worked fine.
There are possibilities of error and authentication problems since we reuse the server by formatting it .

SQL Server Management Studio 2008 Runas user on different domain over VPN

I am currently trying to run SQL Server Management Studio 2008 as a user who is on a different domain. I noticed in other threads that running the following command from a batch script will do this however it doesn't seem to work for me.
runas /netonly /user:DOMAIN\USER "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
I am asked for my password, the Login screen appears however the Windows Authentication username and password are still incorrectly the currently logged in impersonated user on the local Domain. Attempting to connect to the database on the other domain is unsuccessful regardless.
This seems to work for most people, the kicker for me is that this domain exists over a VPN connection. I am not able to view the VPN domain network computers in My Network Places, and thus I cannot Add Users in Control Panel.
My OS is Vista Business unfortunately, I cannot help this.
Any ideas would be appreciated.
Try this:
NET USE \\DBSERVER /USER:DOMAIN\USERNAME
You will be prompted for your password. This establishes a NetBIOS session with the database server. You should be able to see the shared folders and shared printers on the database server once you have done that.
If that works you should be able to connect using SSMS as yourself. You may have to specify "named pipes" as the network protocol to usem, if it doesn't work with TCP (but I think it will).
Menu->File->Connect Object Explorer...
Options->Connection Properties->Network protocol
Specify "Named pipes"
Named Pipes inherits your existing NetBIOS session, so provided you can list the shares you are probably good to go.
Update: It looks like in some configurations this does not work with TCP connections, (possibly due to some security update). In these cases you should enable Named Pipes, and set named pipes in your connection string.

SQL Server does not exist or access denied error

I have an application that runs fine when executed off the server. When clients try to connect, they receive the following error:
Failed to get data.
*Data provider could not be initialized
*SQL Server does not exist, or access denied
on my Office Web Components (MDAC). I am guessing there is some security or server configuration error, but I'm not able to pinpoint it. I am running SQL Server 2005.
*Note - clients can't change their security settings, company policy.
When you try this from a command prompt:
TELNET servername 1433
What happens? If you get a blank screen, then SQL Server is listening and you've got something wrong in your client settings. If you get an "Access denied" or "no response"-type answer, it's most likely either a firewall issue or SQL Server isn't listening, but in either case, it's a server issue.
SQL Server 2005 disables network accessibility by default, you might need to enable it
http://msdn.microsoft.com/en-us/library/ms165647(SQL.90).aspx
Your firewall settings might be preventing connections from your clients. If not, it can be a DNS issue.
Most likely an issue with your firewall not allowing remote connections?
If it's working from the server but clients are having problems, I think the "access denied" part of the error is the key here and it's an authentication problem.
What sort of authentication are you using to authenticate your clients? Is the server using impersonation? If you're running clients and server in an active directory domain, the client application (Office or Internet Explorer for example) might be passing credentials to the server which the server is using to authenticate to the database.
For SQL Server to be contactable from a network machine it requires port 1433 to be open on the server for TCP traffic. Additionally, if you have a named instance you should check the port it is listening on as it may be different to the the default and will probably need to be opened. You will also have to open up port 1434 for UDP to support the SQL Browser Service
firewall issue. diable firewall, run instance again