162

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.

5
  • try pinal dave solutions blog.sqlauthority.com/2009/05/21/…
    – GeoVIP
    Commented Dec 3, 2014 at 10:47
  • This worked for me when I reconnected from server authentication to windows authentication. Commented Dec 28, 2016 at 13:22
  • 1
    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 error
    – Rostol
    Commented Mar 7, 2017 at 1:42
  • 1
    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.
    – camainc
    Commented Dec 11, 2018 at 21:31
  • @camainc: I believe Sql Server does not store its connection strings
    – MSIS
    Commented Sep 28, 2022 at 20:22

23 Answers 23

234

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

8
  • 6
    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!
    – Groco
    Commented Sep 4, 2017 at 19:39
  • 5
    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.
    – Minh Tran
    Commented Sep 13, 2018 at 21:48
  • 1
    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 Authentication
    – Minh Tran
    Commented Sep 13, 2018 at 21:53
  • 1
    I tried logging in using "sa", and got the same error.
    – RonJohn
    Commented Nov 16, 2020 at 13:51
  • 2
    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 :-{ Commented Jun 2, 2021 at 2:23
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

1
  • After doing this, restart SQL Server. Then try to log in.
    – Webucator
    Commented Sep 9, 2020 at 20:50
38

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.

2
  • 2
    I tried all comments but it didn't work. Your solution worked perfect for me. Thank you very much.
    – avantdev
    Commented Feb 6, 2019 at 18:10
  • 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. thanks
    – Myke Black
    Commented Sep 17, 2019 at 8:14
37

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

3
  • 3
    This solved my issue after trying all the other fixes.
    – mini998
    Commented Dec 21, 2017 at 12:20
  • 1
    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? Commented Mar 16, 2020 at 15:51
  • This worked great for me. I can see how easy it is for people to neglect considering this solution. Commented May 7, 2020 at 18:11
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.
7
  • what happened to configuration manager in express 2016? I don't see it available? Oh I have to run SQLServerManager13.msc now
    – Kirsten
    Commented Jan 20, 2018 at 7:16
  • 1
    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 Provider
    – Kirsten
    Commented Jan 20, 2018 at 7:26
  • 1
    @kirsteng Check your installed SQL Server instances. Did you install a default instance (MSSQLSERVER)? Commented Jan 20, 2018 at 10:16
  • 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.
    – Eduardo
    Commented Sep 2, 2018 at 12:24
  • This (sort of) worked. Once I changed the localdb nonsense to 127.0.0.1 it got through.
    – Eric
    Commented Nov 27, 2018 at 19:59
9

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

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.
1
  • this is the most apt answer.
    – sushh
    Commented Aug 7, 2018 at 13:52
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
0
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.

1
  • you save my day!!
    – learner
    Commented Apr 8, 2020 at 6:56
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.

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.

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.

1
  • Same exact thing! I had just created the login just a few minutes before.
    – Aliza Berger
    Commented Sep 19, 2022 at 18:44
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.

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.

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.

1

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

1

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

1
  • You can also usually restart the SQL service for your specific database by locating it in services.msc
    – Zimano
    Commented Nov 1, 2019 at 11:51
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.
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>

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"

1

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

ensure database name(Initial Catalog) is correct

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
1
  • Talk about a "sledgehammer approach" - this dangerous and should not even be considered as a solution.
    – Rab
    Commented Mar 17, 2021 at 15:17
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.

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.
    – Community Bot
    Commented Apr 20 at 6:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.