When I try to connect to my database using enterprise manager I get this error:
A connection could not be established to DBSERVER
Reason: Cannot open user default database. Login failed..
I have know that the server is running and the agent is running. There is
no login issues because I was able to login just mins before this happen. I
tried to change the default db with osql utility. I have restarted the
dbserver and still have the same issue. Can anyone if me an idea of what I
need to do.This is a multi-part message in MIME format.
--020006020604030204030608
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
The SQL login you're trying to use to connect to your SQL server has a
default database defined that either they don't have access to or does
not exist. To get yourself going again you can probably just login to
your server using osql with:
(assuming it's your trusted login you're having problems with)
osql -S MyServer -d master -E
or
(assuming it's a particular SQL login you're having trouble with)
osql -S MyServer -d master -U MyUsername -P MyPassword
And then change your the default DB for that login:
(assuming it's your trusted login...)
1> exec sp_defaultdb @.loginame='MyDomain\MyLogin', @.defdb='master'
2> go
or
(assuming it's a SQL login you're having problems with)
1> exec sp_defaultdb @.loginame='MyUsername', @.defdb='master'
2> go
This should fix up the login you're having issues with by virtue of the
fact that every login on the server can access the master DB.
--
*mike hodgson*
blog: http://sqlnerd.blogspot.com
new admin wrote:
>When I try to connect to my database using enterprise manager I get this error:
>A connection could not be established to DBSERVER
>Reason: Cannot open user default database. Login failed..
>I have know that the server is running and the agent is running. There is
>no login issues because I was able to login just mins before this happen. I
>tried to change the default db with osql utility. I have restarted the
>dbserver and still have the same issue. Can anyone if me an idea of what I
>need to do.
>
>
--020006020604030204030608
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>The SQL login you're trying to use to connect to your SQL server
has a default database defined that either they don't have access to or
does not exist. To get yourself going again you can probably just
login to your server using osql with:<br>
</tt>
<blockquote><tt>(assuming it's your trusted login you're having
problems with)<br>
osql -S MyServer -d master -E<br>
<br>
or<br>
<br>
(assuming it's a particular SQL login you're having trouble with)<br>
osql -S MyServer -d master -U MyUsername -P MyPassword<br>
</tt></blockquote>
<tt>And then change your the default DB for that login:<br>
</tt>
<blockquote><tt>(assuming it's your trusted login...)<br>
1> exec sp_defaultdb @.loginame='MyDomain\MyLogin', @.defdb='master'<br>
2> go<br>
<br>
or<br>
<br>
(assuming it's a SQL login you're having problems with)<br>
1> </tt><tt>exec sp_defaultdb @.loginame='MyUsername',
@.defdb='master'<br>
2> go<br>
</tt></blockquote>
<tt>This should fix up the login you're having issues with by virtue of
the fact that every login on the server can access the master DB.</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font></span> <b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"><br>
<font face="Tahoma" size="2">blog:</font><font face="Tahoma" size="2"> <a
href="http://links.10026.com/?link=http://sqlnerd.blogspot.com</a></font></span>">http://sqlnerd.blogspot.com">http://sqlnerd.blogspot.com</a></font></span>
</p>
</div>
<br>
<br>
new admin wrote:
<blockquote cite="midAE6D082D-667E-4F2E-817A-A603BA650462@.microsoft.com"
type="cite">
<pre wrap="">When I try to connect to my database using enterprise manager I get this error:
A connection could not be established to DBSERVER
Reason: Cannot open user default database. Login failed..
I have know that the server is running and the agent is running. There is
no login issues because I was able to login just mins before this happen. I
tried to change the default db with osql utility. I have restarted the
dbserver and still have the same issue. Can anyone if me an idea of what I
need to do.
</pre>
</blockquote>
</body>
</html>
--020006020604030204030608--|||Thank you soooo much that got me in and now I see that my default db is
(subspect)
"Mike Hodgson" wrote:
> The SQL login you're trying to use to connect to your SQL server has a
> default database defined that either they don't have access to or does
> not exist. To get yourself going again you can probably just login to
> your server using osql with:
> (assuming it's your trusted login you're having problems with)
> osql -S MyServer -d master -E
> or
> (assuming it's a particular SQL login you're having trouble with)
> osql -S MyServer -d master -U MyUsername -P MyPassword
> And then change your the default DB for that login:
> (assuming it's your trusted login...)
> 1> exec sp_defaultdb @.loginame='MyDomain\MyLogin', @.defdb='master'
> 2> go
> or
> (assuming it's a SQL login you're having problems with)
> 1> exec sp_defaultdb @.loginame='MyUsername', @.defdb='master'
> 2> go
> This should fix up the login you're having issues with by virtue of the
> fact that every login on the server can access the master DB.
> --
> *mike hodgson*
> blog: http://sqlnerd.blogspot.com
>
> new admin wrote:
> >When I try to connect to my database using enterprise manager I get this error:
> >
> >A connection could not be established to DBSERVER
> >
> >Reason: Cannot open user default database. Login failed..
> >
> >I have know that the server is running and the agent is running. There is
> >no login issues because I was able to login just mins before this happen. I
> >tried to change the default db with osql utility. I have restarted the
> >dbserver and still have the same issue. Can anyone if me an idea of what I
> >need to do.
> >
> >
> >
> >
>
Friday, February 17, 2012
Connection
Labels:
connect,
connection,
database,
dbserver,
enterprise,
error,
established,
manager,
microsoft,
mysql,
oracle,
server,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment