Cannot open user default database. Login failed.
Login failed for user
how to fix this error, I made a mistake and deleted the database or the mdf, how do you fix this?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lalit MRank #1,186 · 1.5K reputationPosted Mar 14, 2010, 9:57 PM EDT
http://benharrell.wordpress.com/2007/01/15/cannot-open-user-default-database-login-failed-login-failed-for-user-username-microsoft-sql-server-error-4064/
http://benharrell.wordpress.com/2007/06/18/update-cannot-open-user-default-database-login-failed-login-failed-for-user-%E2%80%98username%E2%80%99-microsoft-sql-server-error-4064/
David SmithRank #999 · 2K reputationPosted Mar 14, 2010, 10:09 PM EDT
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 14, 2010, 11:09 PM EDT
<%--I made a mistake and deleted the database or the mdf, how do you fix this? --%>
i think this is your question.. you should have backup of your database. if you have then add that file to your app_data folder and then connect again. if don't have backup try any recovery tool. it not related to programming you have to back it up [mdf] file.
David SmithRank #999 · 2K reputationPosted Mar 15, 2010, 12:02 AM EDT