campusflava

Friday, May 24, 2013

How to Bypass a Sql Server Login Failure

When you attempt to login to your database using SQL Server Authentication, you may get an error saying "Login failed. Login fail 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.

 More updated info on www.campusflava.com

 Steps
  1. 1
    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:

SQL 2005

osql -S SQL01 -d master -U usrlogin -P usrpassword ALTER LOGIN usrlogin WITH DEFAULT_DATABASE=new_default_db

SQL 2000

isql -S SQL01 -d master -U usrlogin -P usrpassword (opens query analyzer, type the next line in there) sp_defaultdb ‘usrlogin’, ‘ new_default_db’


 Tips
  • If this didn’t fix the problem, use one of the resources included below.

No comments: