WSO2 Identity Server

Configuring WSO2 Identity Server (Part I) Setting Up Database

Today I’m going to explain on setting up WSO2 identity server database on a computer with arch Linux as the operating system.

Setting Up MySQL

(01) Install MySQL server with

sudo pacman -S mariadb

(02) Before start, the server run following command

mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

(03) Now the mariadb.service can be started and/or enabled with systemd.

sudo systemctl start mariadb.service

(04) Log in to the MySQL client as the root user (or any other user with database creation privileges).

mysql -u root -p

(05) Enter password when prompted

Screenshot from 2017-02-27 14-35-17.png

(06) In the MySQL command prompt, create the database using the following command:


(07) Give authorization of the database to the regadmin user as follows:

GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin";

(08)Once you have finalised the permissions, reload all the privileges by executing the following command:


(09) Log out from the MySQL prompt by executing the following command:


Setting up datasource configurations

(01) Edit the default datasource configuration in the


file as shown below.

Screenshot from 2017-02-27 14-53-47.png

Creating Database Tables

(01) To create tables in the registry and user manager database (WSO2CARBON_DB), use the below script:

mysql -u regadmin -p -Dregdb < '/dbscripts/mysql.sql';

(02) Restart the server

/bin/ -Dsetup

Possible Errors

  1.  The class name of the JDBC driver to use. Make sure to copy the JDBC driver relevant to the database engine to the /repository/components/lib/ directory. For example, if you are using MySQL, specify com.mysql.jdbc.Driver as the driver and copy mysql-connector-java-5.XX-bin.jar file to this directory. If you do not copy the driver to this directory when you create the datasource, you will get an exception similar to Cannot load JDBC driver class com.mysql.jdbc.Driver.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s