I'm trying to connect to my local SQL Server 2012 via SSMS, but I didn't make it. I got error message :
Cannot connect to EB-OR1007724.
Additional information:
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)
Please notice that I'm using a company computer with many restrictions. After trying several things, but I stilled didn't make it.
Check services are running. All related SQL Server Services are running using Local System as Log On. They're
SQL Full-text Filter Daemon Launcher (MSSQLSERVER), started (PID=2100)
SQL Server (MSSQLSERVER), started (PID=2424)
SQL Server Agent (MSSQLSERVER), started (PID=320)
SQL Server Browser, started (PID=4376)
Check ports' status. The port :1434 is listened by localhost 127.0.0.1.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\xxxxxxxx>netstat -ano
Active Connections
Proto Local Address Foreign Address State PID
...
TCP 127.0.0.1:1434 0.0.0.0:0 LISTENING 2424
TCP [::1]:1434 [::]:0 LISTENING 2424
UDP 0.0.0.0:1434 *:* 3080 1016
UDP [::]:1434 *:* 3080
Check firewall roles. I've created an inbound rule to allow TCP connection to port :1433 and :1434, which can be accessed for all connections by anyone.
Check hosts config. The hosts configuration file hosts has been modified to identified 127.0.0.1 as localhost. This file is located at folder C:\Windows\System32\drivers\etc.
Check availability of other SQL Server services. I can connect to the local SSAS services using my windows authentication.
Check AD Server status. The problem might be caused by a down Active Directory Server. Even though I don't have access to Active Directory Domains and trusts due to company policy, I'm sure that the AD server works, because I can connect to the local SSAS services using my windows authentication.
Check instance name. As you can see, the instance is called MSSQLSERVER, so perhaps I should explicitly mention it when I connect via SSMS ? These are what I've tried in Server name:
EB-OR1007724, error 18452
EB-OR1007724\, error 18452
EB-OR1007724\MSSQLSERVER, error 87
.\MSSQLSERVER, error 87
.\, error 18452
., error 18452
Now I'm really upset upon the result. Please help T_T
Error list
Error 87
Cannot connect to EB-OR1007724\MSSQLSERVER.
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: SQL Network Interfaces, error: 25 - Connection string is not valid) (Microsoft SQL Server, Error: 87)
The parameter is incorrect.
Error 18452
Cannot connect to EB-OR1007724.
Additional information:
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)
For your information, there's a related question on stackoverflow.
Cause
The problem might be caused by company security programs, defined on the network. Since the local service MSSQLSERVER is not a company official service, the Active Directory (AD) Server refuses to provide authentication credentials. (Obviously, this is my hypothesis. ^^)
Solution
As for the solution, I use SQL Server Authentication instead of Windows Authentication to login. In order to do that, make sure your server is running under the Mixed Mode (Windows authentication and SQL Server authentication). This can be configured during the SQL Server 2012 installation, step Database Engine Configuration.
The login is sa (system administrator) and the password is what you've defined previously.
Once connected, you should add new login(s) properly for different usages. As mentioned by Panagiotis Kanavos:
connecting as sa is considered a serious security problem, not a solution of any kind. It should never, ever be attempted in production systems
Related
I am attempting to create the reporting services database for usage in SCCM. The reporting services installed fine (install only), but once I get to the Database tab and try to connect to the database server to create the database, it fails by timing out when trying to connect (see dialog). I am using Authentication Type: Current User - Integrated Security (domain user account loaded with permissions on that server - used by several other SQL apps).
Full text of error message:
Could not connect to server: 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: 50 - Could not open a connection to the SQL Server)
We are using two named instances, so the ports are dynamic. I have made sure all ports are active (netstat).
I also made sure of the following:
All SQL services are running and have been restarted several times
Firewall is disabled (all profiles) - shouldn't matter, because we are running setup locally
Remote connections are enabled in SSMS (again, shouldn't matter)
Named pipes is enabled (as are TCP/IP and Shared Memory); also re-ordered protocols while testing
Tried service accounts using virtual service account, local system, network service and known-good domain SQL service account
Varied Server Name by using machine name, FQDN, local IP, loopback (127.0.0.1) and LOCALHOST
I can ping the server and access IPC$ (as you would expect on the localhost)
I am inside of the SQL Server 2016 Reporting Services Configuration Manager and logged into the SQL Server on the correct instance and the Report Server is showing as Started. I can also user the Web Service URL (although it obviously gives me a DB error).
I have checked the Application Event log and SQL/Reporting Server logs without any hints of the problem.
What could be causing this issue? I have spent hours troubleshooting something that should be so easy.
I didn't realize that the Server name field when creating the database still requires the instance name even though the installation already had that embedded. It was just a matter of clicking that field and accepting the server\instance dropdown. I had the biggest face palm in a very long time.
I have tried every conceivable permutation for hours to try to connect to a remote SQL Server 2017 using SSMS. I keep getting:
Logging failed for user xxx. (Microsoft SQL Server Error 18456)
I know SQL Server is running on the remote machines since I can log
in locally there using SSMS.
SQL Browser is running.
TCP/IP is enabled. There are no dynamic
ports in IP All.
I know the firewall is not a problem since I can
telnet to port 1433 from the remote machine, and I added the rule to allow access.
I have "Enable Remote Access" turned on in SQL Server.
I have both Windows and SQL Server Authentication enabled.
I have user mappings for the given databases.
I can connect locally using SSMS with the Sql Server Auth user/passwd that I am trying to use remotely.
When logging in from the remote client in SSMS:
I use an IP address for the server (although I can also browse to the server as I have UDP 1434 open).
I use SQL Server Authentication.
I looked at Event Viewer on the SQL Server machinee to see if it gives me more clues as to why the log in is failing, but it is worthless.
I saw this, but it is of no help.
What on earth could be left that is the problem?
I have a local installed SQL Server 2016 (Developer edition) installation on Windows 10 Pro. There is one named instance. I am a developer using MS SQL Management Studio and JetBrains DataGrip.
I just want my connections within my local machine to work with SQL Server over TCPIP using a SQL Server user account..! At the moment this only works using my Windows Authentication mapped to ServerAdmin
Named instance
RAXLENOVOT560\MSSQL2016MAIN
(authentication is mixed mode)
There are 3 issues that maybe linked:
TCP Port number does not appear to take effect within the Sql Server Configuration Manager.
The Sql Server Configuration Manager only shows limited properties on the Client Protocols/TCPIP settings. (please see screen shots)
Sql Server login user account does not connect via TCP due to an error. Login within local machine, local development from DataGrip to SQL Server.
1. TCP Port number
I have set this to 65321. However when I try and connect using this port no connection is made.
When I checked using the following SQL query I see the port number is actually 65514
SELECT DISTINCT
local_tcp_port
FROM sys.dm_exec_connections
WHERE local_tcp_port IS NOT NULL
results
local_tcp_port
--------------
65514
I change the port number in the config tool, restart ALL SQL Server services, reboot and still nothing works. Still listening on port 65514
Note I did not choose 65514, this seems to be a default from SQL Server.
2. The Sql Server Configuration Manager Properties Missing
Note the properties screen is limited only to a few options, there are usually lots more why is is? Perhaps due to running on Windows 10 Pro vs Windows Server?
3. Connection Login failure
Login from the local machine only.
I have opened the firewall for all the relevant SQL Server ports
TCP 1433
TCP 65514 (the forced sql server port)
TCP 65123 (what I would like to use)
UDP 1434 Sql Server Browser
I attempted login via a number of means
Sql Server Management Studio
Udl File
Java connection via DataGrip
Since opening the firewall, all the connections work but only if the hostname is 127.0.0.1, why can't I use the computer name? The connections also work if I use my Windows Login but NOT a SQL Server login
The login fails due to the error shown below from the SQL Server Log (which proves the TCPIP connection is reaching SQL Server).
Login-based server access validation failed with an infrastructure error. Login lacks connect endpoint permission
Date 24/04/2018 11:25:05
Log SQL Server (Current - 24/04/2018 11:20:00)
Source Logon
Message
Login failed for user 'SvrDeveloper'. Reason: Login-based server access validation failed with an infrastructure error. Login lacks connect endpoint permission. [CLIENT: 127.0.0.1]
The Sql Server User has the following permissions and settings (please see screenshot)
Name = SvrDeveloper
Server Roles = public
Securables = RAXLENOVOT560\MSSQL2016MAIN Type=Server
Securables = TSQL Default TCP Type=EndPoint
Connections
Udl Connection
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLNCLI11.1;Integrated Security=SSPI;Persist Security Info=True;User ID="SvrAdmin";Password="Password123";Initial Catalog="";Data Source=TCP:127.0.01\MSSQL2016MAIN,65514;Network Library=DBMSSOCN;Initial File Name="";Server SPN=""
Java connection:
jdbc:sqlserver://127.0.0.1:65514;databaseName=CcTools;user=SvrDeveloper; password=Password123
Some additional information:
Version
I am trying to install SQL Server 2014 on Windows Server 2012 R2. I can connect locally using windows authentication and sql server authentication, but when I try to connect remotely using hostname\instance, I get 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: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified) (.Net SqlClient Data Provider)
In SQL Server Network Configuration I have shared memory and tcp/ip enabled and named pipes disabled.
http://snag.gy/GHY8X.jpg
Under TCP/IP Protocol, I have Enabled=Yes, Keep Alive=30000, and Listen All=Yes
http://snag.gy/kL5vK.jpg
Under IP Addresses, I have
http://snag.gy/lgoD6.jpg
The Windows Firewall is turned off (for now). The machines are not part of a domain just p2p workgroup.
The client machine is XP SP3 pro. I tried connecting using SMSS and odbc, but both failed.
Don't know if it is relevant, but I ran sp_readerrorlog on the server and I saw this in the logs
The SQL Server Network Interface library could not register the
Service Principal Name (SPN) [ MSSQLSvc/SERVER_2012:49184 ] for the
SQL Server service. Windows return code: 0xffffffff, state: 63.
Failure to register a SPN might cause integrated authentication to use
NTLM instead of Kerberos. This is an informational message. Further
action is only required if Kerberos authentication is required by
authentication policies and if the SPN has not been manually
registered.
Sql Browser is enabled and running.
Allow remote connections to this server is checked.
Turns out it was the firewall. I had only disabled the firewall for domain not for private network.
I'm trying to connect to my local machine name as "Server Name", and giving windows authentication, but its throwing some 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)
(.Net SqlClient Data Provider)"
Please note previously it was connecting all well some few months back, but now it throws error. I tried lot of alternatives provided around the web, but nothing worked.
Did I miss something ?
If the service is running on your local machine, try connecting with "LocalHost" as the server name.
Also, did you check that the service is running?
There are several reasons for this to happen:
Check if your SQL is up and running
Check there is no firewall messing around
Check on the configuration manager if sql services is up
Check if TCP/IP is active on the configuration manager
Sometimes, I know is weird, but his error shows up if you haven't configured your server for mixed security (both windows and SQL Server). Try connecting with a windows user with SA permissions and activate SQL authentication as well.
To do this, open SQL Server manager and connect with the SA user, right click on the server properties, check the "Security" tab for "SQL Sever and windows authentication mode"
Check this blog post that will lead you from some of the points I told you.
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/