简体   繁体   English

WSO2 API MGR MySQL数据库

[英]WSO2 api mgr mysql db

i guess i'm not the only one trying to play with the new WSO2 API mgr. 我想我不是唯一尝试使用新WSO2 API mgr的人。 As explained in readme, i try to use mysql to store all data. 如自述文件中所述,我尝试使用mysql存储所有数据。 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 : 我在正确的文件中上传了mysql的jdbc驱动程序,现在的问题是更改master-datasources.xml中的设置,但提供的唯一示例在自述文件中,但仅用于mssql,而且我也从未使用过jdbc ...自述中的mssql示例,您如何看待针对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>

In the posted datasource configuration, I see you are using JTDS driver to connect to MySQL which is wrong. 在发布的数据源配置中,我看到您正在使用JTDS驱动程序连接到MySQL,这是错误的。 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. JTDS仅支持MSSQL和Sybase数据库,因此您必须使用MySQL JDBC驱动程序才能正确配置数据源以连接到MySQL后端数据库。 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. 为此,请从[1]下载MySQL JDBC驱动程序并将其放在API_MANAGER_HOME / repository / component / lib文件夹中,然后更改数据源配置,如下所示。

<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>

Regards, Prabath 问候,Prabath

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

我遇到了同样的问题,该页面对我有帮助: http : //shavanthaw.blogspot.mx/2013/02/how-to-connect-wso2-is-server-to.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM