This very basic post mainly using WSO2 API manger with MYSQL rather H2 database.

1. Creating Database in MYSQL

mysql -u root –p

create database regdb;

2. Giving authorization of the database to the user "root."

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

3. Add data source for APIM

<datasource>
         <name>WSO2_CARBON_DB</name>
    <description>The datasource used for registry and user manager</description>
    <jndiConfig>
        <name>jdbc/WSO2CarbonDB</name>
    </jndiConfig>
    <definition type="RDBMS">
        <configuration>
            <url>jdbc:mysql://localhost:3306/regdb</url>
            <username>root</username>
            <password>root</password>
            <driverClassName>com.mysql.jdbc.Driver</driverClassName>
            <maxActive>80</maxActive>
            <maxWait>60000</maxWait>
            <minIdle>5</minIdle>
            <testOnBorrow>true</testOnBorrow>
            <validationQuery>SELECT 1</validationQuery>
            <validationInterval>30000</validationInterval>
        </configuration>
    </definition>
     </datasource>

The database config
url - URL for the database
username  - name of the database user
password - password of the database user
driverClassName  - class name of the database driver

[NOTE]

File located at  <APIM_HOME>/repository/conf/datasources  directory as below. Both the database configurations in  registry.xml  and  user-mgt.xml  refer this data source.

4. Download the MySQL Java connector (mysql-connector-java-5.1.27.jar) JAR from http://dev.mysql.com/downloads/connector/j/5.1.html to <APIM-HOME>/repository/components/lib directory.

5. When you start the server for the first time, use the -Dsetup option. It will create all the tables in the given MySQL database as like all WSO2 prodcuts.

wso2server.bat –Dsetup

OR For Manual Database creation you can enter

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

Here is MYSQL

image

Here I am trying APIM with MYSQL, enjoy

image

0

Add a comment

I am
I am
Archives
Total Pageviews
Total Pageviews
2 0 5 7 7 0 6
Categories
Categories
Loading