I've been using Db2 on Docker with no issues. Today, it says that the password expired.
[jcc][t4][2012][11248][4.27.25] Connection authorization failure occurred. Reason: Password expired. ERRORCODE=-4214, SQLSTATE=28000
According to this post I need to run docker exec -it Db2wh setpass new_password
where Db2wh is the container name, but I get
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: "setpass": executable file not found in $PATH: unknown
How to fix this? I also tried to log in the container's console and run setpass new_password
but the command was not found. How to change this password?
The solution is to shell into the container as root, and to run the command passwd db2inst1
(or whatever the name of the instance owner, default is db2inst1
).
The question gave a doc link to a command that is valid for the Db2-warehouse edition. However the actual image used was the Db2 community edition , which is the reason the setpass
command was not valid.
To change password expiry interval or disable expiry, once again shell into the container as root and run whatever command is relevant for the distro used by the image. For example user the chage
command with appropriate options.