
02-10-2010, 07:16 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
SQL server 2005 - Login failed message
Hi All, could you please help me ?
I'm trying to connect to SQL server 2005 express edition but I've got this error message:
Login failed for user 'PC346519167106\Patricia e Pierre'. The user is not associated with a trusted SQL Server connection.
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'PC346519167106\Patricia e Pierre'. The user is not associated with a trusted SQL Server connection.
at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF (Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unkno wn Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.s endLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l ogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.a ccess$000(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$L ogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Un known Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.e xecuteCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l oginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBCON.main(DBCON.java:32)
I'm using on SQL server 'window authentication' to connect and when I start my PC I'm using a 'PC administrator' user.
Where in SQL server can I manage users accounts ?
Thanks a lot guys !
Pierre.
|
|

02-10-2010, 07:54 AM
|
|
Senior Member
|
|
Join Date: Jun 2008
Posts: 1,622
Rep Power: 4
|
|
|
Sounds like a question for an MS forum.
|
|

02-10-2010, 09:11 AM
|
|
Senior Member
|
|
Join Date: Apr 2009
Posts: 2,107
Rep Power: 4
|
|
|
Have you got Management Studio Express?
Create a user through that, and give it whatever privileges it needs to work with the db you want it to.
I have never used windows authentication to connect. I've always had a "proper" user.
|
|

02-10-2010, 09:24 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
Originally Posted by Tolls
|
Have you got Management Studio Express?
Create a user through that, and give it whatever privileges it needs to work with the db you want it to.
I have never used windows authentication to connect. I've always had a "proper" user.
|
Thanks a lot man,
Yes i've got the Management Studio Express and I will try to find how to do this(create new user on sql server express).
Best Regards, Pierre.
|
|

02-10-2010, 10:01 AM
|
|
Senior Member
|
|
Join Date: Apr 2009
Posts: 2,107
Rep Power: 4
|
|
|
Right click on the security bit in the object explorer on the left and choose New->Login.
|
|

02-10-2010, 10:05 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
Originally Posted by Tolls
|
|
Right click on the security bit in the object explorer on the left and choose New->Login.
|
Thanks again man !!!
Well, I've just created a new user with all grants.....but I still have this error message:
Login failed for user 'pbaudru'. The user is not associated with a trusted SQL Server connection.
(Microsoft SQL Server, error: 18452)
How can I avoid this please ?
Something still need to be donne on login configuration ?
Regards. Pierre.
|
|

02-10-2010, 10:15 AM
|
|
Senior Member
|
|
Join Date: Apr 2009
Posts: 2,107
Rep Power: 4
|
|
Forgot this bit...
Though that doesn't explain why you got that error the first time, unless your connection string in your code was such that it thought you were using a login rather than win-auth.
|
|

02-10-2010, 10:33 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
Originally Posted by Tolls
|
Forgot this bit...
Though that doesn't explain why you got that error the first time, unless your connection string in your code was such that it thought you were using a login rather than win-auth.
|
Thanks man,
I changed to 'mixed mode', but still have a similar error. Note that the 'The user is not associated with a trusted SQL Server connection.(Microsoft SQL Server, error: 18452)' is not in the message anymore....
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'pbaudru'.
at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF (Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(Unkno wn Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.s endLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l ogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.a ccess$000(Unknown Source)Login failed for user 'pbaudru'.
at com.microsoft.sqlserver.jdbc.SQLServerConnection$L ogonCommand.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Un known Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.e xecuteCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.l oginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.c onnect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at DBCON.main(DBCON.java:28)
I logged in SQL server with the pbaudru user this time....or do I need to login with the windows login ?
Here is part of code I'm using:
String connectionString = "jdbc:sqlserver://localhost;database=eureka;user=pbaudru;"
+ "password='testlogin'";
conn = DriverManager.getConnection(connectionString);
Regards. Pierre.
Last edited by pbaudru; 02-10-2010 at 10:35 AM.
|
|

02-10-2010, 10:34 AM
|
|
Senior Member
|
|
Join Date: Jun 2008
Posts: 1,622
Rep Power: 4
|
|
|
That means that either the user doesn't exist or you used the wrong password.
Edit: I mean, you do, normally, know what "login failed" means, don't you?
|
|

02-10-2010, 10:43 AM
|
|
Senior Member
|
|
Join Date: Apr 2009
Posts: 2,107
Rep Power: 4
|
|
|
Can you login to the management console with that user (rather than win-auth)?
|
|

02-10-2010, 10:44 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
Originally Posted by Tolls
|
|
Can you login to the management console with that user (rather than win-auth)?
|
Yes I can....
|
|

02-10-2010, 10:45 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
Originally Posted by masijade
|
That means that either the user doesn't exist or you used the wrong password.
Edit: I mean, you do, normally, know what "login failed" means, don't you?
|
yes but what is missing to the user config to be good man ?
|
|

02-10-2010, 10:55 AM
|
|
Senior Member
|
|
Join Date: Apr 2009
Posts: 2,107
Rep Power: 4
|
|
|
Then your connection in Java is wrong somehow.
Typo, something.
In fact, remove the single quotes around the password....
|
|

02-10-2010, 10:57 AM
|
|
Member
|
|
Join Date: Jan 2010
Location: Athus - Belgium
Posts: 23
Rep Power: 0
|
|
Originally Posted by Tolls
|
Then your connection in Java is wrong somehow.
Typo, something.
In fact, remove the single quotes around the password....
|
yes yes yes man.....I'm connected....thanks a lot man !!!
Best regards !!! Pierre.
|
|

02-10-2010, 10:59 AM
|
|
Senior Member
|
|
Join Date: Jun 2008
Posts: 1,622
Rep Power: 4
|
|
Originally Posted by pbaudru
|
yes yes yes man.....I'm connected....thanks a lot man !!!
Best regards !!! Pierre.
|
Better, of course, would be to use the three argument version of getConnection so you don't have to worry about that sort of url syntax.
|
|

02-10-2010, 11:03 AM
|
|
Senior Member
|
|
Join Date: Jun 2008
Posts: 1,622
Rep Power: 4
|
|
Originally Posted by pbaudru
|
|
yes but what is missing to the user config to be good man ?
|
Well look at your connection code and think about what you've entered there. What, just might, be the problem. Change that and try again. It takes 10 seconds. Instead you post again on a site, what until someone happens to see it, and feels like answering, and you happen to see that it has been answered, and then do that anyway, if anyone was "kind" enough to point out the mistakes that should be, at least somewhat, obvious. Which, of course, all takes alot longer.
IOW, use a little initiative and use that thing on your neck for something other than keeping your feet from floating away.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 09:22 PM.
|
|