<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Fix : Error: 4064 &#8211; Cannot open user default database. Login failed. Login failed for user</title>
	<atom:link href="http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: DeDoS</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-57416</link>
		<dc:creator>DeDoS</dc:creator>
		<pubDate>Sat, 07 Nov 2009 22:45:46 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-57416</guid>
		<description>Thanks...
Work!</description>
		<content:encoded><![CDATA[<p>Thanks&#8230;<br />
Work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-56941</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 23 Oct 2009 14:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-56941</guid>
		<description>Saved my skin there mate. Cheers!</description>
		<content:encoded><![CDATA[<p>Saved my skin there mate. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anita</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-54164</link>
		<dc:creator>Anita</dc:creator>
		<pubDate>Tue, 28 Jul 2009 11:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-54164</guid>
		<description>thanks,
it worked :)</description>
		<content:encoded><![CDATA[<p>thanks,<br />
it worked :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moses</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-54085</link>
		<dc:creator>Moses</dc:creator>
		<pubDate>Sat, 25 Jul 2009 01:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-54085</guid>
		<description>Thanks heaps for this, thought i&#039;d stuffed it!</description>
		<content:encoded><![CDATA[<p>Thanks heaps for this, thought i&#8217;d stuffed it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-53841</link>
		<dc:creator>Imran Mohammed</dc:creator>
		<pubDate>Sun, 19 Jul 2009 17:11:10 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-53841</guid>
		<description>@Kirk 

Ask your SysAdmin to give you access to all other databases. Every login should be mapped to a user in a database, only then a login can enter into that database. 

Exception to above comment would be, if you enable Guest A/c in all databases, then you can access all databases with out actually having a user in any of the database, Which ofcourse is very dangerous, Guest A/c should be disabled all the time in all databases ( Except Master and Tempdb ).

~ IM.</description>
		<content:encoded><![CDATA[<p>@Kirk </p>
<p>Ask your SysAdmin to give you access to all other databases. Every login should be mapped to a user in a database, only then a login can enter into that database. </p>
<p>Exception to above comment would be, if you enable Guest A/c in all databases, then you can access all databases with out actually having a user in any of the database, Which ofcourse is very dangerous, Guest A/c should be disabled all the time in all databases ( Except Master and Tempdb ).</p>
<p>~ IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kirk</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-53825</link>
		<dc:creator>Kirk</dc:creator>
		<pubDate>Sat, 18 Jul 2009 19:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-53825</guid>
		<description>This worked for my login on the master database but I cannot get it to work for the actual database I want the login to refer to.</description>
		<content:encoded><![CDATA[<p>This worked for my login on the master database but I cannot get it to work for the actual database I want the login to refer to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abel</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-53550</link>
		<dc:creator>Abel</dc:creator>
		<pubDate>Wed, 08 Jul 2009 19:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-53550</guid>
		<description>Many thanks....Easy, clean and simple solution!!!!</description>
		<content:encoded><![CDATA[<p>Many thanks&#8230;.Easy, clean and simple solution!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curvian Vynes</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-53547</link>
		<dc:creator>Curvian Vynes</dc:creator>
		<pubDate>Wed, 08 Jul 2009 14:28:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-53547</guid>
		<description>Hi. This did not work for me but this did:

Database properties -&gt; Files

Change owner to relevant user.</description>
		<content:encoded><![CDATA[<p>Hi. This did not work for me but this did:</p>
<p>Database properties -&gt; Files</p>
<p>Change owner to relevant user.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MarkTab</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-53229</link>
		<dc:creator>MarkTab</dc:creator>
		<pubDate>Wed, 24 Jun 2009 13:00:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-53229</guid>
		<description>Thanks Pinal Dave -- I had this problem, and am in an environment where I am remote to the box with limited privileges.  However, the solution works for me.

Some people have had a problem with their username, and in general I use double quotes for any .NET strings (though the square brackets also work):

alter Login &quot;domain\user&quot; with default_database = master
go

&lt;&lt;&gt;&gt;

alter Login [domain\user] with default_database = master
go</description>
		<content:encoded><![CDATA[<p>Thanks Pinal Dave &#8212; I had this problem, and am in an environment where I am remote to the box with limited privileges.  However, the solution works for me.</p>
<p>Some people have had a problem with their username, and in general I use double quotes for any .NET strings (though the square brackets also work):</p>
<p>alter Login &#8220;domain\user&#8221; with default_database = master<br />
go</p>
<p>&lt;&lt;&gt;&gt;</p>
<p>alter Login [domain\user] with default_database = master<br />
go</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keem</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-52749</link>
		<dc:creator>Keem</dc:creator>
		<pubDate>Thu, 04 Jun 2009 21:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-52749</guid>
		<description>Thx Ross. You were a great help coz I had gotten stuck for all this time on that same position. 
Can anyone help me on how to configure my &#039; sql server authentication&#039; login ?</description>
		<content:encoded><![CDATA[<p>Thx Ross. You were a great help coz I had gotten stuck for all this time on that same position.<br />
Can anyone help me on how to configure my &#8216; sql server authentication&#8217; login ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-52715</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Thu, 04 Jun 2009 01:57:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-52715</guid>
		<description>I bashed my head against the same rock that Keem did. the solution is to put the qualified user name in brackets like so

ALTER LOGIN [HOME-PC\User] WITH DEFAULT_DATABASE=master</description>
		<content:encoded><![CDATA[<p>I bashed my head against the same rock that Keem did. the solution is to put the qualified user name in brackets like so</p>
<p>ALTER LOGIN [HOME-PC\User] WITH DEFAULT_DATABASE=master</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sma</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-51960</link>
		<dc:creator>sma</dc:creator>
		<pubDate>Sat, 16 May 2009 12:39:18 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-51960</guid>
		<description>thank u for ur help</description>
		<content:encoded><![CDATA[<p>thank u for ur help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KatyGirl</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-51627</link>
		<dc:creator>KatyGirl</dc:creator>
		<pubDate>Thu, 07 May 2009 02:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-51627</guid>
		<description>So simple !! thanks that worked a treat !</description>
		<content:encoded><![CDATA[<p>So simple !! thanks that worked a treat !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-51569</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 05 May 2009 17:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-51569</guid>
		<description>Thanks! The top search hit I tried (MSKB 307864) didn&#039;t work; the SQLCMD syntax generated a &quot;Sqlcmd: &#039;-E&#039;: Unknown Option&quot; error. Your solution is more intuitive--and, most importantly, actually works! Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks! The top search hit I tried (MSKB 307864) didn&#8217;t work; the SQLCMD syntax generated a &#8220;Sqlcmd: &#8216;-E&#8217;: Unknown Option&#8221; error. Your solution is more intuitive&#8211;and, most importantly, actually works! Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keem</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-50466</link>
		<dc:creator>Keem</dc:creator>
		<pubDate>Fri, 03 Apr 2009 21:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-50466</guid>
		<description>Hey, 
i got a problem which i didn&#039;t realize last time. I&#039;m using windows authentication, and my server name is for example &quot;home-pc\server&quot;, So how do i set the default database in this case ? 
I have tried using the method you give above and replacing the user name with the server name and i get the message below

[
Msg 15151, Level 16, State 1, Line 1
Cannot alter the login &#039;HOME-PC\KEEM&#039;, because it does not exist or you do not have permission.
]</description>
		<content:encoded><![CDATA[<p>Hey,<br />
i got a problem which i didn&#8217;t realize last time. I&#8217;m using windows authentication, and my server name is for example &#8220;home-pc\server&#8221;, So how do i set the default database in this case ?<br />
I have tried using the method you give above and replacing the user name with the server name and i get the message below</p>
<p>[<br />
Msg 15151, Level 16, State 1, Line 1<br />
Cannot alter the login 'HOME-PC\KEEM', because it does not exist or you do not have permission.<br />
]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krishna prakash</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-50403</link>
		<dc:creator>krishna prakash</dc:creator>
		<pubDate>Thu, 02 Apr 2009 05:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-50403</guid>
		<description>Dev 
This is the best solution i fount the google.
Thanks</description>
		<content:encoded><![CDATA[<p>Dev<br />
This is the best solution i fount the google.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keem</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-50372</link>
		<dc:creator>Keem</dc:creator>
		<pubDate>Wed, 01 Apr 2009 15:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-50372</guid>
		<description>Thanks so much. You were really more than helpful....</description>
		<content:encoded><![CDATA[<p>Thanks so much. You were really more than helpful&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lloyd R</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-49233</link>
		<dc:creator>Lloyd R</dc:creator>
		<pubDate>Tue, 17 Mar 2009 00:35:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-49233</guid>
		<description>Thanks, worked. And much simpler than Microsoft&#039;s KB. Used it in SqlExpress2008</description>
		<content:encoded><![CDATA[<p>Thanks, worked. And much simpler than Microsoft&#8217;s KB. Used it in SqlExpress2008</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-46029</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Tue, 27 Jan 2009 17:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-46029</guid>
		<description>We have a UserID and login that is used by an application.  It has been around since mid-2004.  It was working as of last week; today I get the 4064 error message.  I can log in as myself, using Windows Authentication, to the database server machine; i can see the program Userid&#039;s default database, and can in fact run SELECT queries against various tables.  I ran the ALTER statement that you printed above; I also right-clicked the database and made sure that the program UserID had at least SELECT access to the database (it did).  I also set the program UserID&#039;s default database to Master.  (The database desired is listed in the program&#039;s connection string.)

When I close and restart SQL Server 2005 and attempt to login as the program UserID, I still get the 4064 error message.

I&#039;m stumped.</description>
		<content:encoded><![CDATA[<p>We have a UserID and login that is used by an application.  It has been around since mid-2004.  It was working as of last week; today I get the 4064 error message.  I can log in as myself, using Windows Authentication, to the database server machine; i can see the program Userid&#8217;s default database, and can in fact run SELECT queries against various tables.  I ran the ALTER statement that you printed above; I also right-clicked the database and made sure that the program UserID had at least SELECT access to the database (it did).  I also set the program UserID&#8217;s default database to Master.  (The database desired is listed in the program&#8217;s connection string.)</p>
<p>When I close and restart SQL Server 2005 and attempt to login as the program UserID, I still get the 4064 error message.</p>
<p>I&#8217;m stumped.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wwd</title>
		<link>http://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/#comment-46023</link>
		<dc:creator>wwd</dc:creator>
		<pubDate>Tue, 27 Jan 2009 12:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=1461#comment-46023</guid>
		<description>hi, thanks for the solution.
its really help to sort out things. accidently detached the database. run into trouble due to unable to login with windows authentication.

thank for help</description>
		<content:encoded><![CDATA[<p>hi, thanks for the solution.<br />
its really help to sort out things. accidently detached the database. run into trouble due to unable to login with windows authentication.</p>
<p>thank for help</p>
]]></content:encoded>
	</item>
</channel>
</rss>
