This guide will show you how to change passwords after the KOP container is built, for both OS and MySQL users. 

Contents

How to change the password of KOP container operating system users

By default, there are two operating system users:

  • root
  • kiuwan (defined by KIUWAN_USER property at settings.custom file)

In case you need to change the password for any of these users, please follow these steps:

  1. Log-in to KOP container with root user
  2. Change the password of the user by using common linux commands
    • By default, only root and the configured user for tunning Wildfly exist into the KOP container
  3. After modifying the password, make sure you persist docker image:
    • logout from the container and login to docker server

    • execute : docker commit <kop docker name> <kop docker image>

      • NOTE: run 'docker ps' to get NAMES and IMAGE values of your KOP container

How to change the password of MySQL users

By default, there are two MySQL users:

  • root
  • kiuwan (defined by KIUWAN_MYSQL_USER property at settings.custom file)

Root 

In case you need to change the password for MySQL root, please follow these steps:

  1. Log-in to KOP container with root user
  2. Connect to mysql shell by executing:
    • mysql -uroot -p mysql ( password as defined by MYSQL_ROOT_PWD property at settings.custom file)
  3. Within mysql shell execute following commands
    1. UPDATE user SET Password=PASSWORD('new_password') WHERE USER='root';

    2. FLUSH PRIVILEGES;

Kiuwan

In case you need to change the password for MySQL kiuwan, please follow these steps:

  1. Log-in to KOP container with root user
  2. Connect to mysql shell by executing:
    • mysql -uroot -p mysql ( password as defined by MYSQL_ROOT_PWD property at settings.custom file)
  3. Within mysql shell execute following commands
    • UPDATE user SET Password=PASSWORD('new_password') WHERE USER='kiuwan'; ( user as defined by KIUWAN_MYSQL_USER property at settings.custom file)

    • FLUSH PRIVILEGES;

    • exit;
  4. Change to directory of the container where KOP is installed (KIUWAN_VOL property at settings.custom file)
  5. Execute next commands (substituting old_password and new_password with your proper values) :
    • sed -i 's|password=old_password|password=new_password'|g' deployconfig/kiuwan/configuration/WEB-INF/classes/config/hibernate/csaas-hibernate.properties

    • sed -i 's|^KIUWAN_MYSQL_PWD=.*|KIUWAN_MYSQL_PWD=new_password'|g' koptools/deployKiuwan.sh
    • sed -i 's|password=old_password|password=new_password'|g' release/installation/conf/db-connection.properties

    • ONLY if you are using HTTPS :
      • sed -i 's|password=old_password|password=new_password'|g' deployconfig/kiuwan/configuration/WEB-INF/classes/config/application.properties.http.rollback

      • sed -i 's|^KIUWAN_MYSQL_PWD=.*|KIUWAN_MYSQL_PWD=new_password'|g' koptools/deployKiuwan.sh.http.rollback

  6. Change to koptools
  7. Execute next script :
    • ./redeployKiuwan.sh