HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

DB2 passwords with special characters

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
withpasswordsdb2specialcharacters

Problem

Our DB2 authentication is integrated with active directory, so the allowed passwords are controlled by it's policy. We have some users that are not being able to connect to the database through Command Editor or the Query screen in Control Center. The error is the following:

SQL0104N An unexpected token "!" was found following "".
Expected tokens may include: "NEW".
SQLSTATE: 42601
sqlcode: -104

They are able to connect through Command Line Processor as far as they don't include the password in the connect statement.

The problem is affecting all users with some special characters in their passwords. We had them try issuing the connect statement without the password in Command Editor but it didn't work.

The exact version of the database is DB2/AIX64 9.5.4

Is there a way for them to use this tools other that to have them change their passwords?

Thanks

Solution

This is a long-standing bug in the GUI tools.

However, as long as your password does not contain a double quote (") character, then you can work around this by putting double quotes around the password to connect.

connect to sample user test using test!
--> SQL0104N

connect to sample user test using "test!"
--> connection succeeded.


This method will also work if the GUI tools prompt you for a password with a dialog box.

If you have passwords with double quotes in them, you may be out of luck. You could open a ticket with IBM DB2 support and/or just change the password.

Code Snippets

connect to sample user test using test!
--> SQL0104N

connect to sample user test using "test!"
--> connection succeeded.

Context

StackExchange Database Administrators Q#3081, answer score: 5

Revisions (0)

No revisions yet.