1
votes

I had downloaded and installed DB2 community edition on my machine. I had supplied a password while installing DB2 for the instance db2inst1. At this moment, I'm able to connect to this DB2 database using the db2inst1 user and the supplied password, from DBeaver.

Now I am trying to update the password from command line using the command db2 "CONNECT TO HELLO USER db2inst1 USING <literally_that_same_password_used_earlier_in_dbeaver> NEW <new_password> CONFIRM <new_password>".

This unfortunately does not work, throwing me an error: SQL30083N Attempt to change password for user id "db2inst1" failed with security reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001.

I am sure that I am providing the same password as in DBeaver, when I try to change the password from terminal. I'm not sure why this is happening though.

I'm using DB2 Developer Community Edition (docker) on Mac

2
Anything in the string that needs escaping? Have you tried to invoke the CLI ("db2") and then issuing the CONNECT? - data_henrik
Same error unfortunately - Sparker0i
On MS-Windows, or Linux? Using the docker-version or non-docker? - mao
Mac, docker version - Sparker0i
In the terminal for the container, become db2inst1 and use the passwd command to change the password (instead of using Db2 to front that action). Remember that the error message can refer to either the old or the new password, Passwords will need to comply with whatever rules are configured for the container. - mao

2 Answers

3
votes

Extending to Sparker0i's ans, below are the steps:

docker exec -it conatiner_name bash
su - db2inst1
passwd

It'll ask you to type old and new password.

2
votes

Turns out, I had to change the OS level password inside the Docker container using passwd command, and not through the DB2 provided mechanism