I am facing a problem to use the DB2 tools when using generic account with a generated password which ends with the Bang sign '!' to connect to DB2 database. I am not allowed to change the password because it is already used by other processes.

I know the user is valid and I can connect to the database with its credentials, but not from all db2 tools.

When using the Control Center it is okay. When using the Command Editor (GUI) or the Command Windows, I got this error message:

connect to WAREHOUS user administrator using       !
SQL0104N  An unexpected token "!" was found following "<identifier>".  
Expected tokens may include:  "NEW".  SQLSTATE=42601

Let's say that my password is: pass@! I am trying to use

c:\>db2 connect to sample user administrator using "pass@!"


c:\>db2 connect to sample user administrator using pass@!

And it both cases I got the same error message.

I could change the way I connect but it is not useful for me, for example:

c:\>db2 connect to sample user administrator
Enter current password for administrator:

But I cannot use it from a batch file easily.

I would like to know how can I connect from the Command Editor, in order to use this user from the Graphical Tools.

BTW, I know that the Control Center is deprecated.

migrated from stackoverflow.com Nov 11 '11 at 5:46

This question came from our site for professional and enthusiast programmers.

  • I would recommend that you use this opportunity to document what the various other processes are that are using this password, and to separate them to using their own credentials (characters confined to a-z, A-Z, 0-9), to avoid the lock-in problem in the future. – Rob Pearson Sep 25 at 16:02

For the command line, you can try single quotes

c:\>db2 connect to sample user administrator using 'pass@!'

No solution for the GUI tools

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.