Tuesday, March 27, 2012

Can't get in to SQLServer 2005 express with a Privileged account

Bummer. I can't remember the SA password. I had setup a user account, but I can't change anything or add any new accounts using this login. I can't get in using the windows authentication method no matter how I am logged into this machine.

Any suggestions? I have never been able to use Windows Authentication. There must be something I'm missing here. I have spent hours and hours trying to get into this machine. I just want to replicate a database. This is very frustrating.

Thanks guys.

How are you connecting to SQL Server? On Express edition, Windows authentication should always work even if you are non-admin.

You can also try using Windows Authentication with a user account that is a machine admin.

Alternatively, members of this Windows Group: SQLServer2005MSSQLUSER$<machine_name>$<instance_name> should also have access. Please replace the <machine_name> and <instance_name> variables with the appropriate values for your installation. So if you add your Windows user to this group, you should also have access.

What error message are you seeing?

Sung

|||

It was telling me that I couldn't access the default database. I found where someone said to do:

sqlcmd -E -d master

That allowed me to get the SQLCMD prompt. I didn't know what to do after that. I found in the SQL Server 2005 Administrator's Pocket Consultant that you can make any user an administrator by issuing the command:

sp_addsrvrolemember 'login', 'sysadmin'

That did the trick. I was able to elevate the one login that I knew to sysadmin status. From there I had full access and privileges.

Thanks for your response.

No comments:

Post a Comment