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
(06) In the MySQL command prompt, create the database using the following command:
CREATE DATABASE regdb CHARACTER SET LATIN1;
(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.
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
- 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.