When you attempt to login to your database using SQL Server Authentication, you may get an error saying “Login failed. Login faile for user `usrLogin`. (Microsoft SQL Server, Error: 4064)”. This problem may occur if the database that was set to be the default for that specific login was deleted.
- Update the login to have a default database that you know exists. Here’s how to fix it. Open a command prompt and type the following:
osql -S SQL01 -d master -U usrlogin -P usrpassword ALTER LOGIN
isql -S SQL01 -d master -U usrlogin -P usrpassword (opens query analyzer, type the next line in there)
You may like our other article on How to Reset Sa Password in Sql Server 2005