How to change password of a database in DB2 software of IBM?

ypahalajani picture ypahalajani · Apr 11, 2015 · Viewed 14.1k times · Source

However, it seems very trivial - How to get the current username of a database in DB2 software in IBM; But, trust me, when it comes to entering the database username and password while connecting DB2 with eclipse, you might have to wait for a time which is tediously long. Let's get straight to the point:-

This is how you get the username of a database in DB2.

  1. open DB2 Command Line Processor .
  2. Connect to your database:-

         db2 => connect to <database_name>
    
  3. Enter this query in db2 clp:-

         db2 =>  SELECT CURRENT USER FROM SYSIBM.SYSDUMMY1
    
  4. You'll get the current user name of the current database that you have accessed.

Now, the main problem is :- How to get / change the password if one has forgotten the password. And, What is the difference between database password and the one that i entered while installing DB2 ?

Answer

Ian Bjorhovde picture Ian Bjorhovde · Apr 12, 2015

DB2 does not have its own set of IDs and passwords; it relies on the operating system to perform authentication. So your ID and password are what you used to log in to Windows (or Linux, AIX, etc); and you change your password as you do normally on each platform.

The password you entered during installation is for a different ID - DB2 created a new user on your local machine. On Windows the ID is called db2admin by default.