Ananth
Ananth

Reputation: 10720

Unable to Connect to Local SQL Server with Windows Authentication using SSMS

I'm trying to login to my local SQL Server 2005 installed on Windows7 using SSMS using Windows authentication.

I tried using various server names like ., localhost, .\SQL, ANANTH-PC etc.

I get this error when I try . or localhost

enter image description here

And I get this error when I try .\SQL

.enter image description here

I had gone for default instance and Windows authentication when I installed SQL Server.

I've checked the service in the SQL Server Configuration manager and find that MSSQLSERVER is running.

How can I find the server name that I should enter to login to SQL Server? Any help ?

Error is loged as

2012-01-26 15:07:16.02 Logon       Login failed for user 'Ananth-PC\Ananth'. [CLIENT: <local machine>]
2012-01-26 15:08:51.06 Logon       Error: 18456, Severity: 14, State: 11.

Upvotes: 9

Views: 43580

Answers (6)

Alper Ebicoglu
Alper Ebicoglu

Reputation: 9624

I reset my local SQL server with the following CMD commands:

sqllocaldb stop mssqllocaldb
sqllocaldb delete mssqllocaldb
sqllocaldb start "MSSQLLocalDB"

Upvotes: 0

For SQL Server 2019 Express on SSMS, the default format of MSSQL Server Name is:

<Your PC Name>/SQLEXPRESS

This is in my case below:

DESKTOP-HN1U0ME/SQLEXPRESS

enter image description here

For SQL Server 2019 Developer on SSMS, the default format of MSSQL Server Name is:

<Your PC Name>

This is in my case below:

DESKTOP-HN1U0ME

enter image description here

Upvotes: 1

Rinoy Ashokan
Rinoy Ashokan

Reputation: 1619

Give server name as "(LocalDb)\v11.0" by selecting windows authentication. Please see the image.enter image description here

It worked for me with SQLServer 2014.

Upvotes: 0

user2376833
user2376833

Reputation: 1

Please enable the administrator Account throngh this command secpol.msc and enable admin and log the PC and Login the Administrator account and run SQL Server 2005.

Upvotes: 0

Ananth
Ananth

Reputation: 10720

Ran SSMS as Administrator and issue was fixed.. Accepting the previous answer as it guided me to this solution

Upvotes: 10

devarc
devarc

Reputation: 1157

That should help you find reason. Click: "Show technical details" and look at State number.

http://blogs.msdn.com/b/sql_protocols/archive/2006/02/21/536201.aspx

Upvotes: 2

Related Questions