4

When I start Management Studio, unless I use the "Run as Administrator" selection, I cannot login to my local SQL Server. Is this normal? I am a normal developer and don't believe I have a need for high security on my local machine.

I'm running SQL Server 2008, Windows 7.

The error I get is:

Cannot connect to (local)
Additional Information
Login failed for user 'MYCOMPUTER\MyName'. (Microsoft SQL Server, Error: 18456)

This seems to be a reoccurring theme because when I run visual studio, I have a similar login failure when I run database accessing code. Optimally, I would like a solution that solves both cases.

9

Most likely your problem is that your database is setup to only have logins defined for administrative users. Go into Management Studio as an admin user, and go to the Security -> Logins category. You probably only have some built in SQL users, and SERVERNAME\Administrators.

Right click the Logins category, and choose "New Login..." - from there you can add your non-admin user SERVERNAME\MedicineMan and give it the sysadmin server role. This will give it admin rights to the database while leaving it as a normal user on the Windows system.

  • I'll try this tonight. I hope it works. – MedicineMan Apr 8 '10 at 17:51
0

This may be relevant if the means of logging into sql server is using 'windows authentication'.

I am just adding that even when an sql authenticated login has been set up in the sql instance, and given the 'sysadmin' privelege - this problem can still happen ! I really wish I could understand why this problem happens under this circumstance - but have yet to learn the reason. I support a commercial program that uses microsoft sql server on windows, and I routinely see about 33% of our customers MUST 'RunAsAdmin' (using an sql authenticated login) for them to be able to successfully log into sql server).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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