WSO2 API Manager is a fully open-source full lifecycle API Management solution that can be run anywhere. It can be deployed on-prem, on a private cloud, is available as a service on cloud or deployed in a hybrid fashion where its components can be distributed and deployed across multiple cloud and on-prem infrastructures

Some time we need to configure Relation Database like MySQL . We can find configuration details in MySQL Setup Link. You can access API Manager 2.10 MySQL setup Link as well.

Below are the steps to create database table which are available in above links as well,

1. Create below table in MySQL databases

  •  apimgtdb
  • mbstoredb
  • regdb
  • userdb
  • wso2am_stats_db

Create database command would be like below ,

 create database ; 

2. Update the master-datasources XML file to create datasource connection in APIM.

Master  datasource file location :

/repository/conf/datasources/master-datasources.xml 

 

Update the MySQL database credentials in <datasource>

Data Source

Data Source

Update the high lighted field values .

Also Add “&useSSL=false” to URL tag

i.e.

<url>jdbc:mysql://{MYSQL_HOSTNAME}:3306/apimgtdb?autoReconnect=true&amp;useSSL=false</url>

It solves the connection error related to SSL.

[2020-04-20 17:43:22,443] ERROR – BlockConditionDBUtil Error while executing SQL
java.sql.SQLException: Data source is not configured properly.
at org.wso2.carbon.throttle.service.impl.BlockConditionDBUtil.getConnection(BlockConditionDBUtil.java:91)
at org.wso2.carbon.throttle.service.impl.BlockConditionDBUtil.getBlockConditions(BlockConditionDBUtil.java:108)
at org.wso2.carbon.throttle.service.impl.BlockConditionDBUtil.getBlockConditionsDTO(BlockConditionDBUtil.java:201)

 

Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)

 

To create all the related database tables ,You can run below command, after creating all databases and completing the editing of master-datasources.xml, user-mgt.xml, registry.xml files. It is for initial database setup only once.


wso2server.bat -Dsetup

After all tables got create follow the regular wso2 API Manager run command to start wso2 API manager.

 wso2server.bat --run 

You can go through the WSO2 documentation for more information.

Post you queries If you have any.

Happy Reading…..