LocalDb - Logon failed for login 'xx\xxx' due to trigger execution

2021-06-03

_config.yml I encountered an issue - Logon failed for login 'xx\xxx' due to trigger execution today when I tested my local site. I expanded details from SSMS to investigate with no luck. I tried to re-install SQL 2019 localdb, reverted back to old version of localdb, none of them fixed my issue.

Fixes

After spending nearly an hour on this issue, I concluded my localdb MSSQLLocaldb was corrupted. I decided to delete and re-create MSSQLLocaldb to see if it works. Luckily, this approach fixed my issue.

Step 1 - Delete MSSQLLocaldb folder

The folder can be found from the location below.

C:\Users\<username>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances

Step 2 - Re-create MSSQLLocaldb database

Run the following command from your terminal

sqllocaldb create MSSQLLocaldb

References

Logon failed for login due to trigger execute

Happy Coding! 😇