[Platform] MySQL8 Data Connection Plugin

  • Last update:  2022-01-17
  • I. Overview

    1. Version

    Report Server VersionJAR Plugin VersionFeature Changes
    10.0.112020-11-27V1.0.0-


    2. Application scenarios

    Install this plugin users can directly MySQL8 database.


    3. Function introduction

    This article is only applicable to report servers after 10.0.11. To connect to MySQL8 database, please refer to: Connect to MySQL

    II. Operation method

    1. Install the plugin

    Click to download the plugin: 

    fr-plugin-connection-mysql8-1.0.0.zip

    Server installation plug-in method refer to: Server plugin management


    2. Configuration Information

    DriverURLDriver download linkSupport database type
    com.mysql.cj.jdbc.Driverjdbc:mysql://ip:port/<database name>?useSSL=false&serverTimezone=UTCPlugin built in mysql-connector-java-8.0.20.jar driver package, so there is no need to download8.0.20
    If users want to connect to other minor versions of MySQL8, they can try to replace the driver package. For details, please refer to: III. Replacing the driver package

    URL description:

    The parameter "&serverTimezone=UTC" is added to prevent the database garbled problem caused by the time zone, where UTC is the universal time, which is the zero time zone. If the time used by the user's system, report server, etc. is Beijing time zone, that is, the East Eighth District, the data time that will appear in the FineReport data preview interface is eight hours faster than the time in the database, and the parameter can be modified as &serverTimezone=GMT%2B8 , where "GMT%2B8" is the East Eighth District of Beijing time. It can be ensured that the time field in the database is consistent with the time field in the Finereport data preview interface.


    3. Connection steps

    1) The administrator logs in to the decision-making platform, clicks Manage > Data Connection > Data Connection Management, clicks New Data Connection, and selects MySQL8 under all options, as shown in the following figure:

    Note: If a non-admin user wants to configure a data connection, the administrator needs to assign him the authority to manage the data connection node under the system. For details, please refer to Data Connection Authorization.

    1.png

    2) Enter the corresponding data connection information according to the configuration information in Section II.2 of this article. The advanced settings are optional. For details, please refer to: [Platform] Configure data connection . After entering the information, the interface is as shown below:

    2.png

    If there are Chinese garbled characters and dates (fill in & preview):

    The URL can be modified to:

    jdbc:mysql://localhost:port number/<database name>?generateSimpleParameterMetadata=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai

    • serverTimezone=Asia/Shanghai-- The setting is based on "Shanghai time zone"

    • characterEncoding=utf8 -- encoding conversion

    For details about Chinese garbled characters in MySQL databases, please refer to: MySQL Database Chinese Garbled

    3) Click Test Connection, if the "Connection Successful" prompt box pops up, it means that the connection to the database is successful, as shown in the following figure:

    3.png

    4) Click Save to create a new MySQL8 data link, as shown below:

    4.png

    III. Replace the driver package

    If you are using other minor versions of MySQL8, you can try to replace the driver package.

    Due to the numerous minor versions of MySQL 8, the connection cannot be guaranteed after replacing the driver package. Therefore, qualified users are recommended to use the MySQL 8.0.20 version database directly.

    1. Operation steps

    1) Close the designer project.

    2) Download the connection driver package corresponding to the current MySQL minor version from the MySQL official website. Take MySQL 8.0.17 as an example, download the driver package mysql-connector-java-8.0.17.jar

    3) Delete the "mysql-connector-java-8.0.20" file under %FineReport_10.0%\webapps\webroot\WEB-INF\plugins\plugin-com.fr.plugin.connection.mysql8-1.0.0, and Copy the downloaded driver package to this path

    5.png

    4) After changing the driver, restart the designer project and connect to the database according to Section II.2 and Section II.3.


    Attachment List


    Theme: Data Preparation
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy