11

Is it possible to change the user account of the localdb instance in SQL Server? We changed our domain and it is using my old domain account so I can no longer login anymore. Also, I don't believe that you can login with SQL auth, so the sa account doesn't work, I tried that. I am using both SQL Server 2014 and 2016.

bkorzynski
  • 541
  • 1
  • 5
  • 15
  • 1
    If you can't login with SQL Auth or Domain account then there is no way to use it. The only way is to get someone that can get in with elevated privileges to create you a local SQL Auth account or hook you up with windows auth in the new domain. – Wes Palmer Nov 28 '16 at 20:00
  • 9
    I found the fix, you need to go to ***C:\Users\UserName\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances*** and delete the ***instanceName*** folder, then in SSMS login to that instance ***(localdb)\instanceName*** and it will recreate that ***instanceName*** folder with the correct permissions. After that you need to just re-attach your databases from ***C:\Users\UserName\*** and you are all set. – bkorzynski Nov 28 '16 at 21:05
  • @bkorzynski, you last comment helped me a lot! Thank you... – shahsani Dec 04 '17 at 10:07
  • @shahsani awesome, glad I could be of assistance – bkorzynski Dec 04 '17 at 19:15
  • 3
    @bkorzynski you should move this comment into an answer - this is the correct answer and should be accepted for visibility. – Thiago Silva Dec 15 '20 at 17:18

1 Answers1

0

If it is a local DB and you are totally locked out you will probably have to uninstall and reinstall. When you uninstall your data and log files should be left in the original location. After you reinstall you can Attach the files to the new instance of the server. If this is a machine used by everyone in the business someone should be able to login with elevated privileges and set you up with what you need.

Here is an example of how to reattach database files.

Wes Palmer
  • 880
  • 4
  • 15