Reset admin password on SQL server

Hi all

I just tried to login to my local TeamCity installation and it fails. It seems that I forgot the password (I had it safely stored somewhere but TeamCity isn't letting me in). So now I'm looking for a way to reset the admin password. I know there's a document on the wiki describing how to do it but that only goes for the default authentication (which I have) and the default database (which I don't have). So is there a way to reset the admin password or otherwise get back into my installation. I don't mind nuking the users and adding a new one but I'd prefer not to lose the projects. It's kind of an experimental setup and I don't really want to redo the work I've to get it here.

Oh and I'm on TeamCity 4.5.4 (build 9071) with SQL server 2008 express.

Thanks

Patrick

2 comments
Comment actions Permalink

Hi!

I've seen a table dbo.users in my SQL Server database, with a PASSWORD field (encoded of course).
I've seen a table dbo.usergroup_roles, with a ROLE_ID field, that can be SYSTEM_ADMIN.

I do not have a solution but can suggest you to set the SYSTEM_ADMIN role on another user that you know the password, adding a row in the dbo.usergroup_roles.

Another solution could be to replace the PASSWORD field of dbo.users for your admin user with a hash that correspond to a password you already know.

Hope it'd help! Tell me if it works!

Olivier.

0
Comment actions Permalink

You can change password of your user account right in the users table. MD5 is used for password encoding.

0

Please sign in to leave a comment.