sreda, 10. junij 2009

SQLCODE=-4214 on DB2 on Linux

If you get SQLCODE=-4214 when you try to connect to a database running on Linux then you can do:
usermod --password `openssl passwd PASSWORD_TO_USE` USERNAME

The problem is that DB2 doesn't like SHA-512 hashes, but MD5.
On Ubuntu you can also change /etc/pam.d/common-password and change line
password [success=1 default=ignore] pam_unix.so obscure sha512

to
password [success=1 default=ignore] pam_unix.so obscure md5

Now changing the password will use MD5 hashes instead of SHA-512. This is a bit unsecure, so you decide if you need it. usermod should do the trick anyway.
Just remember that DB2 expects username on Linux (probably on every UNIX) to be all lowercase.