Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2003
    Posts
    5

    Unanswered: Unable to connect to database using "USER" & "USING"

    Hi All,
    when trying to connect to db2 (V7.1) while deing logged in as db2inst1 I have no problem connecting to a database.
    However whn I try to connect while logged in as a different user or using an application using the command "connect to database as user db2inst1 using db2inst1" I get an error saying "incorrect username and/or password" even though I know these to be the correct username and password?

    Any ideas?

    Thanks in advance

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Unable to connect to database using "USER" & "USING"

    connect to <dbnme> user <uid> using <pwd>

    What's the SQLCode ? Any errors in db2diog.log
    Cheers

    Sathyaram

    Originally posted by thesraid
    Hi All,
    when trying to connect to db2 (V7.1) while deing logged in as db2inst1 I have no problem connecting to a database.
    However whn I try to connect while logged in as a different user or using an application using the command "connect to database as user db2inst1 using db2inst1" I get an error saying "incorrect username and/or password" even though I know these to be the correct username and password?

    Any ideas?

    Thanks in advance

  3. #3
    Join Date
    Apr 2003
    Posts
    5

    Re: Unable to connect to database using "USER" & "USING"

    SQL1403N The username and/or password supplied is incorrect. SQLSTATE=08004

    When I am logged in as the user with uid db2inst1 and passwd db2inst1 I can connect using the command "connect to database"

    However if I use the command "connect to database user <uid> using <passwd"> I get the above error.
    (In fact even if I am already logged in as db2inst1 and try the line user/using I get the same error)

  4. #4
    Join Date
    Apr 2003
    Posts
    5

    Re: Unable to connect to database using "USER" & "USING"

    Oh and no errors in the log

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Unable to connect to database using "USER" & "USING"

    The last time I saw such a behaviour(though I dont remember what the error message was) , there was a problem with the access permissions on the directory itself and files in sqllib/security directory ...

    Make sure 'Others' have Execute access on these files and 'Others' can 'cd security'

    Cheers

    Sathyaram

  6. #6
    Join Date
    Apr 2003
    Posts
    5

    Unhappy Re: Unable to connect to database using "USER" & "USING"

    Hi Sathyaram,
    I tried that like you suggest but with no joy. ANy other suggestions would be appreciated because I'm stumped. I've also had problems starting the Admin Server. Would that have any bearing on it?

    SQL1042C An unexpected system error occurred. SQLSTATE=58004 when I try to start db2admin

    This problem is minor though compared to the usermname and password error as I am developing an application to connect to the database so I obviously need to have some form of user authentication. Even worse when users who are not db2inst1 they will not be able to connect!!

    John

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Unable to connect to database using "USER" & "USING"

    missed to specify it last post ...
    Is db2ckpw owned by root ...

    This is the program invoked when you try to connect using a user-id and password ... The permission on it should look like

    -rwsr-s--x 1 root grp1 15989 03 Apr 19:32 sqllib/security/db2ckpw

    Cheers

    Sathyaram

  8. #8
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Unable to connect to database using "USER" & "USING"

    Have you changed the password for db2admin server ?

    If so, you will need to do
    db2admin setid /user <user> /password <pwd>
    Use db2admin -h if you have syntax errors ...

    Cheers

    Sathyaram

    BTW: I am assuming you run under some Unix

    Cheers

    Sathyaram

    Originally posted by thesraid
    Hi Sathyaram,
    I tried that like you suggest but with no joy. ANy other suggestions would be appreciated because I'm stumped. I've also had problems starting the Admin Server. Would that have any bearing on it?

    SQL1042C An unexpected system error occurred. SQLSTATE=58004 when I try to start db2admin

    This problem is minor though compared to the usermname and password error as I am developing an application to connect to the database so I obviously need to have some form of user authentication. Even worse when users who are not db2inst1 they will not be able to connect!!

    John

  9. #9
    Join Date
    Apr 2003
    Posts
    5

    Re: Unable to connect to database using "USER" & "USING"

    I am running uder Red Hat 8. The fact the admin server isn't runnig doesn't bother me UNLESS it has something to do with the other errors.

    I changed the permissions like you said

    -rwxrwxrwx 1 db2inst1 db2iadm1 18893 Feb 28 13:51 db2aud
    -rwxrwxrwx 1 db2inst1 db2iadm1 4096 Feb 28 13:38 db2audit.cfg
    lrwxrwxrwx 1 root root 34 Feb 28 13:51 db2chkau -> /usr/IBMdb2/V7.1/security/db2chkau

    -rwSr-S--x 1 root db2iadm1 16181 Feb 28 13:51 db2ckpw
    -rwxrwxrwx 1 db2inst1 db2iadm1 24220 Feb 28 13:51 db2flacc


    But now I get the following error

    SQL1402N Unable to authenticate user due to unexpected system error.

  10. #10
    Join Date
    Apr 2003
    Location
    Melbourne, Australia
    Posts
    53
    If you are trying to connect to db2 as a different user on a UNIX/LINUX box then you need to run the db2profile file in the beginning and then try connecting to the DB.

    Suppose there's a user, guest, who needs to access the DB from command prompt on a unix/linux box then, here's what you have to do

    1. Login to the server as guest
    2. Run the db2profile file by issuing the command,
    $. /home/db2inst1/sqllib/db2profile
    3. Type, db2, to start the db2 session
    4. In the db2 prompt, type connect to <dbname> user db2inst1 using <password>

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •