Skip to content

Browsing the H2 Database

WSO2 Identity Server is shipped with a default H2 database. In some product scenarios, you may need to access a database table to see how it works, to troubleshoot, or to try out the scenario.

Follow the instructions given below to connect to the H2 database and browse through it.

H2 is not recommended in production

The embedded H2 database is NOT recommended in enterprise evaluation, testing and production environments. It has lower performance, clustering limitations, and can cause file corruption failures. Please use an industry-standard RDBMS such as Oracle, PostgreSQL, MySQL, or MS SQL instead.

  1. Open the <IS_HOME>/repository/conf/deployment.toml file and add the following configuration.

    enable_h2_console = "true"
  2. Restart the WSO2 Identity Server and access the following URL via your browser: http://localhost:8082


    If you are logged in to the management console, logout before connecting to the database.

  3. WSO2 Identity Server ships with two datasources. They are by default connected to the default  H2 database.

    • WSO2_SHARED_DB - The database which stores registry and user management data.
    • WSO2_IDENTITY_DB - The database specific for the identity server which stores identity related data

    After accessing the URL provided in step 2 you will be prompted to provide the following data.

    Element Description
    username username of the database. By default wso2carbon
    password password of the database. By default wso2carbon
    JDBC URL location of the H2 database. All the default databases are located at <IS_HOME>/repository/database location.

    Please refer the following for sample details that should be provided to connected to each database.

    1. JDBC URL : jdbc:h2:[file path to <IS_HOME>/repository/database/WSO2IDENTITY_DB]
    2. username : wso2carbon
    3. password  : wso2carbon
    1. JDBC URL : jdbc:h2:[file path to <IS_HOME>/repository/database/WSO2SHARED_DB]
    2. username : wso2carbon
    3. password  : wso2carbon

The database tables are listed on the left. You can now browse through them as required.