Thursday, January 29, 2015

Reset WSO2 ESB Admin password

During my current WSO2 ESB project the supplied admin password of the Admin Console didn't work anymore and I needed a way to reset the admin password.
After googling I came out at the following URI: https://docs.wso2.com/display/Carbon401/Changing+User+Passwords+in+the+Carbon+Database
This tutorial used the default h2 database, which was different to the MySql database we used, so I needed to tweak it a little bit to work.

The initial go failed already because I didn't have Ant installed, which is a pre-requisite.

Pre-requisites
* Ant is installed
* WSO2 ESB server is stopped
* The 'mysql-connector-java-5.1.27-bin.jar' is available in the WSO2ESB/repository/components/lib
   folder

Actions to be taken
- Navigate to the WSO2ESB/bin folder
- Execute the 'chpasswd.sh' command:
  ./chpasswd.sh --db-url "jdbc:mysql://<server-name>:3306/wso2users" --db-driver "com.mysql.jdbc.Driver" --db-username <user> --db-password <password>
- Next you will get a prompt in which you can change your admin password.

Have fun with it!!

5 comments:

  1. Hello,
    I'm Christophe and I'm from France.
    I can not make it work chpasswd.sh
    Here is the error below. Would you have an idea as I have been looking for 5 days.
    Looking forward to reading you


    log4j:WARN Error during default initialization
    java.lang.NoClassDefFoundError: org/wso2/carbon/bootstrap/logging/LoggingBridge
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi,
    I'm Dave.
    I'm not able to make chpasswd.sh work with PostgreSQL. I have the postgresql-connector in my repository/components/lib folder and when I run the command, I get the following:

    Database driver [org.postgresql.Driver] not found in classpath.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Copy the database driver jar to the [CARBON_HOME]/lib directory and run the command.

      Delete