No process is on the other end of the pipe (SQL Server 2012)
Asked Answered
T

23

160

I've got this error:

A connection was successfully established with the server, but then an error occurred
during the login process. (provider: Shared Memory Provider, error: 0 - No process is
on the other end of the pipe.)

(Microsoft SQL Server, Error: 233)

I know, there are similar questions on this site, and the answer is, to enable TCP/IP and pipes. But I enabled both, and still doesn't work:

MSSQL error

I am using Microsoft SQL Server 2012 and the user has full permissions.

Talesman answered 3/12, 2014 at 9:14 Comment(5)
try pinal dave solutions blog.sqlauthority.com/2009/05/21/…Prepossession
This worked for me when I reconnected from server authentication to windows authentication.Deputation
What worked for me (sql express 2016) ... Removing mixed authentication leaving just windows auth, restarting service, switch it back to mixed auth, restart service. until i did this nothing fixed the No process errorConstantine
For what its worth, check the connection string in your config file. For me someone had modified one of the server names and checked it in. My code was trying to hit a database that didn't exist on my server.Serrated
@camainc: I believe Sql Server does not store its connection stringsCraver
T
229

The server was set to Windows Authentication only by default. There isn't any notification, that the origin of the errors is that, so it's hard to figure it out. The SQL Management studio does not warn you, even if you create a user with SQL Authentication only.

So the answer is: Switch from Windows to SQL Authentication:

  1. Right click on the server name and select properties;
  2. Select security tab;
  3. Enable the SQL Server and Windows Authentication mode;
  4. Restart the SQL Server service.

You can now connect with your login/password.

Here are the directions by Microsoft: https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/change-server-authentication-mode?view=sql-server-ver15

Talesman answered 3/12, 2014 at 12:14 Comment(7)
The option was correctly checked, so I checked 'Windows Authentication', I restart the service then I check 'Windows Authentication + SQL Authentication' to fix that problem. So happy!Hampstead
To clarify @Groco's comment: Log in using Windows Authentication >> Right-Click your server >> Properties >> Security (Under Select a page) >> Under Server Authentication select SQL Server and Windows Authentication mode. Close SQL Server Management Studio, restart the SQL Server service, and try logging in again.Dannadannel
The issue I had was that Server Authentication was set to Windows Authentication mode. And regardless of the correct password input, I was always greeted with A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.). Throughout the error, I was able to log in using Windows AuthenticationDannadannel
thank you so much. reatart the Sql Service fixed my problem.Insolence
I tried logging in using "sa", and got the same error.Ptosis
For those like me who saw this answer and chased it down also see the answer below "Another reason for this error could be incorrect or non-existent database name.". I chased the Auth Settings and network settings only to find it was the age old "underscore versus dash" issue on the DB name :-{Pyrogenic
This also fixed the same issue I was having in SQL Server 2019Carmarthenshire
K
65

To solve this, connect to SQL Management Studio using Windows Authentication, then right-click on server node Properties->Security and enable SQL Server and Windows Authentication mode. If you're using 'sa' make sure the account is enabled. To do this open 'sa' under Logins and view Status.

enable sa admin

If this didn't work, you may need to reinstall SQL Server

Krucik answered 11/11, 2015 at 20:59 Comment(1)
After doing this, restart SQL Server. Then try to log in.Shechem
N
37

Also you can try to go to services and restart your Sql server instanceenter image description here

Najera answered 17/11, 2016 at 4:57 Comment(3)
This solved my issue after trying all the other fixes.Umlaut
Uh, shouldn't this come with a big warning label that restarting the sql server service just because you can't connect will break other things that have sucessfully connected?Actinology
This worked great for me. I can see how easy it is for people to neglect considering this solution.Devitt
A
36

So, I had this recently also, for integrated security, It turns out that my issue was actually fairly simple to fix but mainly because I had forgotten to add "Trusted_Connection=True" to my connection string.

I know that may seem fairly obvious but it had me going for 20 minutes or so until I realised that I had copied my connection string format from connectionstrings.com and that portion of the connection string was missing.

Simple and I feel a bit daft, but it was the answer for me.

Airminded answered 14/12, 2018 at 1:21 Comment(2)
I tried all comments but it didn't work. Your solution worked perfect for me. Thank you very much.Saxhorn
this was the last thing that I tried after all the other stuff of checking tcp is enabled, adding mixed mode authentication and restarting sql browser service and it worked. thanksZillion
D
19

Another reason for this error could be incorrect or non-existent database name.

Forcing the TCP/IP connection (by providing 127.0.0.1 instead of localhost or .) can reveal the real reason for the error. In my case, the database name specified in connection string was incorrect.

So, here is the checklist:

  • Make sure Named Pipe is enabled in configuration manager (don't forget to restart the server).
  • Make sure the database you are connecting to exists.
  • Make sure SQL Server Authentication (or Mixed Mode) is enabled.
Dyslogistic answered 10/5, 2015 at 7:53 Comment(7)
what happened to configuration manager in express 2016? I don't see it available? Oh I have to run SQLServerManager13.msc nowAnnapurna
When I changed to 127.0.0.1 I got error message Message=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) Source=Core .Net SqlClient Data ProviderAnnapurna
@kirsteng Check your installed SQL Server instances. Did you install a default instance (MSSQLSERVER)?Dyslogistic
The SQL Server Authentication in mixed mode did it for me. Guys if you do a fresh installation of SQL Server Express, when you want to add a user for your progamming needs, you need to change it to mixed mode otherwise only windows authentication will be avilable.Oceangoing
This (sort of) worked. Once I changed the localdb nonsense to 127.0.0.1 it got through.Sanderlin
It was the database name for me. There was nothing else for me to do except fix the name. I think that should be emphasized here. I will attempt to fix that.Sabbat
I was doing a DevExpress XAF Blazor tutorial. That documentation says that the framework will create the Db the first time it runs. Ha. Once I created both the primary Db and the "EasyTest" Db the app ran. Thanks MD.Indomitability
P
9

Please check this also enter image description here Also check in configuration TCP/IP,Names PipeLine and shared memory enabled

Percentile answered 22/3, 2016 at 7:4 Comment(0)
R
8

If you are trying to login with SQL credentials, you can also try changing the LoginMode for SQL Server in the registry to allow both SQL Server and Windows Authentication.

  1. Open regedit
  2. Go to the SQL instance key (may vary depending on your instance name): Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQLServer\
  3. Set LoginMode to 2

enter image description here

  1. Restart SQL service and SQL Server Management Studio and try again.
Ramose answered 1/5, 2018 at 22:46 Comment(1)
this is the most apt answer.Ferromagnesian
H
5

I face this issue for the second time and all previous answers failed, fortunately the following request do the job:

Alter login [user] with CHECK_POLICY = OFF
go

Alter login [user] with CHECK_POLICY = ON
go
Hampstead answered 18/10, 2017 at 18:53 Comment(0)
B
5

For me the password expired for my login user, and i got the same exception. Then i login with Windows Authentication mode and change the password for the associated user, and it solved my problem.

Briefing answered 16/5, 2018 at 14:12 Comment(1)
you save my day!!Stoughton
R
5

Yup, this error might as well be "something failed, good luck figuring out what" - In my case it was a wrong username. SQL Server 2019 RC1.

Romanticist answered 30/10, 2019 at 15:31 Comment(0)
P
3

Had this error too, the cause was simple, but not obvious: incorrect password. Not sure why I didn't get just "Login failed" from freshly installed SQL 2016 server.

Pinch answered 3/10, 2019 at 15:30 Comment(0)
L
3

Always try to log in using those credentials with SQL Management Studio. This might reveal some more details that you don't get at runtime in your code. I had checked the SQL + Windows authentication, restarted the server but still no luck. After trying to log in using SQL Management, I got this prompt:

screenshot

Somehow the password had expired although the login was created just minutes before. Anyway, new password set, connection string updated and all's fine.

Ley answered 6/9, 2020 at 16:18 Comment(1)
Same exact thing! I had just created the login just a few minutes before.Lilt
E
2

I have the same proplem "A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)"

My connection is:

server=POS06\SQLEXPRESS; AttachDbFilename=C:...\Datas.mdf;Initial Catalog= Datas; User ID= sa; Pwd=12345; Connect Timeout=10;

But My SQL is POS06\MSQL2014

Change the connection string to

server=POS06\MSQL2014 ; AttachDbFilename=C:...\Datas.mdf;Initial Catalog= Datas; User ID= sa; Pwd=12345; Connect Timeout=10;

it worked.

Elemi answered 27/11, 2016 at 10:52 Comment(0)
S
2

This might help others. After writing my db routines at home, all working fine. Brought it to work and got this error as well. Might assert same error, different reason. I mistyped the database name when fixing up my code. Ooohh! More coffee ;) Looking back now, kind of makes sense in my case the login/user was good (an admin account) but with a bad database name, there was nothing on the end of the pipe. Why not say "Database does not exists...? And be clear.

Salientian answered 6/7, 2022 at 3:14 Comment(0)
U
2

Right-Click your server name >> Go to Properties >> to Security >>Under Server Authentication >> select SQL Server and Windows Authentication mode >>restart the SQL Server service, and login.

Ulaulah answered 19/8, 2023 at 19:31 Comment(0)
T
1

make sure that you have specified user in Security-> Logins, if no - add it and try again.

Threedecker answered 18/6, 2018 at 11:47 Comment(0)
S
1

Follow the other answer, and if it's still not working, restart your computer to effectively restart the SQL Server service on Windows.

Stambaugh answered 24/10, 2018 at 1:4 Comment(1)
You can also usually restart the SQL service for your specific database by locating it in services.mscDanaedanaher
L
1

In my case the database was restored and it already had the user used for the connection. I had to drop the user in the database and recreate the user-mapping for the login.

  1. Drop the user

    DROP USER [MyUser]
    

It might fail if the user owns any schemas. Those has to assigned to dbo before dropping the user. Get the schemas owned by the user using first query below and then alter the owner of those schemas using second query (HangFire is the schema obtained from previous query).

select * from information_schema.schemata where schema_owner = 'MyUser'
ALTER AUTHORIZATION ON SCHEMA::[HangFire] TO [dbo]     
  1. Update user mapping for the user. In management studio go to Security-> Login -> Open the user -> Go to user mapping tab -> Enable the database and grant appropriate role.
Lavation answered 19/1, 2021 at 9:56 Comment(0)
K
1

In my case, login works fine remotely, via VPN. But connecting from the server where sql server was installed, it failed.

Turns out, the instance name is not the default eg. SQLEXPRESS. Hence, it needs to be explictly specified when connecting.

enter image description here

enter image description here

Server name: .<instance_name> eg. ".\I01"

I don't have to do this if I'm connecting remotely, just <server_hostname>,<port_number>

Kenney answered 6/4, 2021 at 8:41 Comment(0)
O
1

In my case the Database was not created yet (not existent), but the error in EF Core 7.0.3 was

"No process is on the other end of the pipe"

Oosperm answered 12/3, 2023 at 19:57 Comment(0)
M
1

ensure user account of sql server that want to login is exist

ensure database name(Initial Catalog) is correct

Mahican answered 16/3, 2024 at 3:21 Comment(0)
W
0

In my case: Assign a sysadmin role to the user.

  1. Login as windows authenticated user
  2. Go to: Security->Login->Right click user->Assign server role as sysadmin
Whiteside answered 9/2, 2021 at 4:23 Comment(1)
Talk about a "sledgehammer approach" - this dangerous and should not even be considered as a solution.Dutiable
D
0

I got this error while using PPDM (PETA POCO -Micro ORM) and the issue was I passed mandatory date field as 'NOTHING' by mistake. But the ORM was returning this error. There was no issue with the Sql Connection.

Dollop answered 16/4, 2024 at 11:27 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Coercive

© 2022 - 2025 — McMap. All rights reserved.