WSO2 API MGR MySQL数据库 [英] WSO2 api mgr mysql db

查看:94
本文介绍了WSO2 API MGR MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我不是唯一尝试使用新WSO2 API mgr的人. 如自述文件中所述,我尝试使用mysql存储所有数据. 我在正确的文件中上传了MySQL的jdbc驱动程序 现在的问题是更改master-datasources.xml中的设置,但提供的唯一示例在自述文件中,但仅用于mssql,而且我也从未使用过jdbc ... 在自述文件中使用mssql示例,您如何看待针对mysql定制的设置:

i guess i'm not the only one trying to play with the new WSO2 API mgr. As explained in readme, i try to use mysql to store all data. I uploaded in the correct file the jdbc driver for mysql now the question is to change the setting in master-datasources.xml but the only example provided is in the readme file but only for mssql and i also never used jdbc ... using the mssql example in README what do you think of this setup customized for mysql :

    <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:jtds:mysql://db.mydomain.com:3306/USERDB</url>
                <username>USER</username>
                <password>USER</password>
                <driverClassName>net.sourceforge.jtds.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>
    </datasource>

推荐答案

在发布的数据源配置中,我看到您正在使用JTDS驱动程序连接到MySQL,这是错误的. JTDS仅支持MSSQL和Sybase数据库,因此必须使用MySQL JDBC驱动程序才能正确配置数据源以连接到MySQL后端数据库.为此,请从[1]下载MySQL JDBC驱动程序并将其放在API_MANAGER_HOME/repository/component/lib文件夹中,然后更改数据源配置,如下所示.

In the posted datasource configuration, I see you are using JTDS driver to connect to MySQL which is wrong. JTDS only support MSSQL and Sybase databases and therefore you have to use the MySQL JDBC driver in order to get the datasource configured properly to connect to a MySQL backend database. To do that, Download the MySQL JDBC driver from [1] and place it inside API_MANAGER_HOME/repository/component/lib folder and change the datasource configuration as shown below.

<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://hostname_or_ip:3306/database_name</url>
                <username>valid_mysql_username</username>
                <password>valid_mysql_password</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
            </configuration>
        </definition>

关于, 普拉巴特

[1] http://dev.mysql.com/downloads/connector/j/

这篇关于WSO2 API MGR MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆