Thursday, March 22, 2012

Error: 18456, Severity: 14, State: 16. Login failed for user

Hello.

I get this error when I try to connect to my SQL Server with JDBC:

Excepcion en MyPool Pool.getNewConnection() [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot open database "lituania" requested by the login. The login failed.

And in the ERRORLOG I get:

2002-02-22 19:59:46.62 Logon Error: 18456, Severity: 14, State: 16.

2002-02-22 19:59:46.62 Logon Login failed for user 'frontend'. [CLIENT: 10.0.0.75]

I found it is supossed to be a password mismatch:

http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

but I checked the password is correct.

Any ideas? Thank you in advance.

State: 16

It means the login does not have permissions to log into the target database, i.e. lituania in your case.

This is also indicated by the error msg: --> Cannot open database "lituania" requested by the login. The login failed.

So, please make sure you grant access privilige to "frontend".

|||Been there / done that. Maybe I'm not granting the access priviledge correctly.

What I do is right-clicking over the lituania database within the Microsoft SQL Server Management Studio Express. Then I go to Properties -> Permissions -> Users or roles: frontend -> Explicit permissions for frontend: (and in the Grant column I grant actually everything) -> OK

Still the same problem.

Please help.|||Hi,

navigate through Security > Logins > Properties > User Mapping > Choose the Database > Map the user to the database (you will see that he will get the public role by default)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||I did that and then checked db_accessadmin (that was unchecked) and leave public checked (anyway I cannot uncheck it). Then I pressed OK and got the message:

Create failed for user 'frontend'. (Microsoft.SqlServer.Express.Smo)
Additional information:
An exception ocurred while executing a Transact-SQL statement or batch, (Microsoft.SqlServer.Express.ConnectionInfo)
User, group or role 'frontend' already exists in the current database. (Microsoft SQL Server, Error: 15023)

Any ideas?|||moving to SQL Security forum. Somebody should be able to help you.|||

I got the same problem. May anyone help me to solve this?

Thanks a lot!

|||

You should check the database permissions catalog for database 'lituania', to verify that the user 'frontend' is actually granted access permissions to the database.

Thanks
Laurentiu

No comments:

Post a Comment