I. Overview
1. Version
Report Server Version | JAR | Plugin Version | Feature Changes |
---|---|---|---|
10.0.11 | 2020-11-27 | V1.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
Driver | URL | Driver download link | Support database type |
---|---|---|---|
com.mysql.cj.jdbc.Driver | jdbc:mysql://ip:port/<database name>?useSSL=false&serverTimezone=UTC | Plugin built in mysql-connector-java-8.0.20.jar driver package, so there is no need to download | 8.0.20 |
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.
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:
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:
4) Click Save to create a new MySQL8 data link, as shown below:
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
4) After changing the driver, restart the designer project and connect to the database according to Section II.2 and Section II.3.