Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / March 2007

Tip: Looking for answers? Try searching our database.

User ID issue - urgent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 26 Mar 2007 16:42 GMT
I'm trying to create a new user ID for a database on my box, I keep getting
the message

'Login failed for user 'ID'. The user is not associated with a trusted SQL
Server connection.

I add the ID under the default security tab, then associate that id to the
database I want the ID linked to.
what am I doing wrong with this?
Russell Fields - 26 Mar 2007 16:54 GMT
John,

Is your SQL Server configured to only support Trusted Connections?
On the Security tab of Server Properties there are two radio buttons:
* Windows Authentication Mode
* SQL Server and Windows Authentication Mode

If you have the first selected, then a SQL Server account cannot login.
Could that be the problem?
RLF

> I'm trying to create a new user ID for a database on my box, I keep
> getting the message
[quoted text clipped - 5 lines]
> database I want the ID linked to.
> what am I doing wrong with this?
John - 26 Mar 2007 16:59 GMT
I thought that was the issue as well. I checked and I have SQL Server and
windows Auth checked and I'm still gettting the error.

This is nerve racking. I've been trying to figure this out most of the
morning.

> John,
>
[quoted text clipped - 16 lines]
>> the database I want the ID linked to.
>> what am I doing wrong with this?
Russell Fields - 26 Mar 2007 18:28 GMT
John,

Was there anything unusual about this account?  Have you restored a
database?  Master or your target database? If anything looks odd, try.

1. Dropping ID as a user of any database.
2. Dropping the ID login.
3. Recreating the Login and User.

What happens?  Do you get any error messages during this process?

RLF
>I thought that was the issue as well. I checked and I have SQL Server and
>windows Auth checked and I'm still gettting the error.
[quoted text clipped - 22 lines]
>>> the database I want the ID linked to.
>>> what am I doing wrong with this?
John - 26 Mar 2007 22:22 GMT
i did do a restore from a backup database. I dropped the ID, and db several
times, I recreated the database and user ID several times and still getting
the error message.

> John,
>
[quoted text clipped - 34 lines]
>>>> the database I want the ID linked to.
>>>> what am I doing wrong with this?
Sue Hoegemeier - 26 Mar 2007 19:01 GMT
And one other thought....if you changed the authentication to SQL
Server and Windows Authentication from Windows Only, the service needs
to be restarted for those changes to take affect. Maybe you changed to
allow SQL Authentication but haven't restarted the service?
From what tool, application or what steps result in the error message
"Login failed for user 'ID'. The user is not associated with a trusted
SQL Server connection."
Does this involve a connection string at all or are you trying through
SQL Server tools?

-Sue

>I thought that was the issue as well. I checked and I have SQL Server and
>windows Auth checked and I'm still gettting the error.
[quoted text clipped - 22 lines]
>>> the database I want the ID linked to.
>>> what am I doing wrong with this?
John - 26 Mar 2007 22:22 GMT
I get the error when i try to login to the db from my web app and when I try
to use query analyzer.

> And one other thought....if you changed the authentication to SQL
> Server and Windows Authentication from Windows Only, the service needs
[quoted text clipped - 34 lines]
>>>> the database I want the ID linked to.
>>>> what am I doing wrong with this?
Erland Sommarskog - 26 Mar 2007 22:57 GMT
> I get the error when i try to login to the db from my web app and when I
> try to use query analyzer.

Did you try restarting SQL Server? As Sue said, you need to cycle the
server if you change the login options.

Can you log in with any SQL Server login?

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

John - 27 Mar 2007 14:08 GMT
I tried that and still nothing, and No I can only login using windows auth
and I have the option SQL and Windows auth checked but an actual ID and PWD
doesn't work for this one database

>> I get the error when i try to login to the db from my web app and when I
>> try to use query analyzer.
[quoted text clipped - 3 lines]
>
> Can you log in with any SQL Server login?
Russell Fields - 27 Mar 2007 19:01 GMT
John,

To recap what I think you are saying:

1 - The server is set to SQL and Windows authentication, not SQL only.
2 - You have restarted the server since the authentication model was set.
3 - You are working with a restored database.
4 - You have dropped and recreated the ID login and the database several
times.
5 - You can only login using Windows authentication, despite the server
setting.
6 - However, despite point 5, you say this database is the only one for
which ID and PWD does not work.

Certainly, by now you are frustrated and none of us have been a big help so
far. So, using the list above a couple of actions to try:

A. Considering points 3 and 4:
If you did not do already, you FIRST need to drop the database _user_ named
"ID" BEFORE creating the SQL Server _login_ named "ID".    Make the new "ID"
a database user and grant it the appropriate roles and rights.

This is because the restored database _user_ can have a SID that does not
match the SQL Server _login_ SID that you create with the same name.
(Unless you set the SID in the CREATE LOGIN statement.)

SQL Server Management Studio can make it look like the login and user are
linked, even though they actually are not because the SIDs are different..
(Probably something on the fix list for SSMS.)

B. Considering points 1, 2, and 5, if action A does not help:
Set a password for 'sa' that you can remember, change the server to SQL only
authentication mode, and reboot.  See how connecting to SQL Server works for
you, SQL accounts, Windows logins, etc.  Login as 'sa' then set the mode
back to SQL and Windows authentication, the reboot again.  Now see what
happens when you try to login.

C.  Considering point 6:
This only makes sense to me if this can be solved by Action A.  But perhaps
I misunderstand what you were saying.

RLF

>I tried that and still nothing, and No I can only login using windows auth
>and I have the option SQL and Windows auth checked but an actual ID and PWD
[quoted text clipped - 7 lines]
>>
>> Can you log in with any SQL Server login?
John - 28 Mar 2007 13:53 GMT
I got it to work this time. I had to delete te
> John,
>
[quoted text clipped - 51 lines]
>>>
>>> Can you log in with any SQL Server login?
John - 28 Mar 2007 13:55 GMT
I got it to work.

I had to delete the database, stop the SQL services, recreate the database,
restore the database from the backup file, recreate the user, stop and start
the service again, and I had to reboot my box. Then I was able to access the
database via Server management studio with the ID and PWD I created for it.

Oh, I'm using SQL 05 also

> John,
>
[quoted text clipped - 51 lines]
>>>
>>> Can you log in with any SQL Server login?
Erland Sommarskog - 27 Mar 2007 22:33 GMT
> I tried that and still nothing, and No I can only login using windows
> auth and I have the option SQL and Windows auth checked but an actual ID
> and PWD doesn't work for this one database

First, which version of SQL Server are you using? You mentioned that you
was logging in from Query Analyzer, that would indicate that you are on
SQL 2000?

Your answer is a bit contradictive. You talk about "this one database",
as if the problem was only with one database one the server. With the
error message you posted, which database you are trying to connect to
would not matter.

So I like you to clarify again: are you able to log in with SQL
authentication with any user (for instance sa) to any database? Yes, we
are asking the same things all over again, but without access to your
system, you will have to be exact, so we don't get in doubts of what you
are doing. From what you have said this far, I'm suspecting that you
are looking at one server in Enterprise Manager, and trying to connect
from another?

By the way, what is the connection string in your application?

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.