SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


sql server login failure


sql server login failure

Author
Message
sej2008
sej2008
Mr or Mrs. 500
Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)Mr or Mrs. 500 (551 reputation)

Group: General Forum Members
Points: 551 Visits: 394
I am working with asp.net and try to access through my login form sql server
database mydb
when logging in as windows user my_pc\xyzuser it fails throwing error :
login failed for user my_pc\xyzuser can not access database mydb.user does not exists.
what should be done for workaround
connectionstring is:
data source=localhost;integrated security=true;initial catalog=mydb

pls suggest different solution.....??
anthony.green
anthony.green
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13116 Visits: 6519
Create the user in the database and assign it the correct permissions or change your connection string to use SQL auth with an account that has access.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


kevaburg
kevaburg
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2339 Visits: 1025
Firstly create your user login at the instance-level and map the user to the database you want access to.

Secondly, from the Security tab of the database, assign the user the correct rights and permissions and accessibility should be assured!

If it isn't then I suggest checking your collation to ensure that, if your collation is Case Sensitive (CS) and not Case-Insensitive (CI) that you have typed your database exactly as presented.
sqlnaive
sqlnaive
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4879 Visits: 2774
Sej, Though it's little old post but did you got it rectified ? As the SQL masters told, the error message clearly shows that there is no user created in database level. So you need to create DB user in your database mapping it to the login you created at server level. Thereafter grant the DB level user some permissions and thereafter try. Remember:
Step 1: Create login at server level [security at server level is called login]
Step 2: Create user at DB level [Login created at Step 1 to be mapped to this new user] Map permissions to this user as per requirement.
Step 3 (not mandatory): Repeat Step 2 in each database, in which this new user requires permission.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search