Download and install MySQL in you computer, if it is not already done.
And Start the MySQL service.
log in to mysql client using root user (Or any other user with the privilege to create databases).
mysql -u root -p
You will be prompted to enter the password. (In most systems the default root password is blank. Press enter without typing anything if you haven't changed
the default root password). This will present you the MySQL command prompt.
In the MySQL prompt, create the registry database using the following command.
create database regdb;
Now give authorization of the registry database to the user "regadmin".
GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin"Now logout from the mysql prompt by typing the "quit" commanad.
quit;
Setup Configuration Files
Edit the registry.xml file (inside the $CARBON_HOME/conf directory) of the deployed registry instance as below. (note the highlighted configurations, You
may use your own database name, username and password).
Explanation of the database configuraiton options.
url: The URL of the database
userName: The name of the database user
password: The password of the database user
maxActive: The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.
maxWait: The maximum number of milliseconds that the pool will wait (when there
are no available connections) for a connection to be returned before throwing an
exception, or <= 0 to wait indefinitely.
minIdle: The minimum number of active connections that can remain idle in the
pool, without extra ones being created, or 0 to create none.
Edit the user-mgt.xml file (inside the $CARBON_HOME/conf directory) of the deployed instance as below. (note the highlighted configurations, You
may use your own database name, username and password).
Download the mysql java connector jar from
http://dev.mysql.com/downloads/connector/j/5.1.html and
Place it in the $CARBON_HOME/repository/components/lib directory (Here $CARBON_HOME refers to the directory where you run the WSO2 Governance Registry instance).
Create Database
Automatic Database Creation
Next at the first time you start the regisry, run with the -Dsetup option, so
it will create all the tables in given mysql database.
wso2server.sh -Dsetup
wso2server.bat -Dsetup
You just configured WSO2 Governance Registry to run with MySQL database!
Manual Database Creation
Run the MySQL scripts for both registry and user manager (embedded inside the
Registry) databases, provided with the WSO2 Governance Registry using the below commands.
(outside the mysql prompt)
mysql -u regadmin -p -Dregdb < 'CARBON_HOME/dbscripts/mysql.sql';
Note: You will be prompted to enter the password for each command.
start the wso2 registry instance.
wso2server.sh
wso2server.bat