The connection method for mysql8 is different, so it's separated out.
https://blog.csdn.net/qq_42891999/article/details/104880596
- Download the mysql8.0 jar driver.
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.19
-
Place the downloaded mysql driver into the lib folder of the kettle installation files, then restart Spoon.
-
Two ways to connect.
The first method:
Select Generic Database for the database type.
Fill in the custom connection URL:
jdbc:mysql://localhost:3306/sys?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL
(Note:
Replace localhost with your database address.
Replace 3306 with your database port number.
sys is your database name.)
Fill in the custom driver class name: com.mysql.cj.jdbc.Driver
Just enter the username and password.
Description | Parameter |
---|---|
Dialect | Generic Database |
Custom Connection URL | jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL |
Custom Driver Class Name | com.mysql.cj.jdbc.Driver |
Username | Database user |
Password | Database password |
Important parameters for the custom connection URL
(https://www.cnblogs.com/itzyz/p/12153875.html)
jdbc | Connection method |
mysql | Database |
localhost | Database address (IP address of the server where the database is located) |
test | Database name (for example, there is a database named test in the mysql database, which contains many tables.) |
useUnicode | Whether to use Unicode character set; if the characterEncoding parameter is set to gb2312 or gbk, this parameter must be set to true |
characterEncoding | When useUnicode is set to true , specify the character encoding. For example, it can be set to gb2312 or gbk |
autoReconnect | Whether to automatically reconnect when the database connection is interrupted? |
autoReconnectForPools | Whether to use a reconnection strategy for database connection pools |
failOverReadOnly | After a successful automatic reconnection, should the connection be set to read-only? |
maxReconnects | Number of retries for connecting when autoReconnect is set to true |
initialTimeout | Time interval between two reconnections when autoReconnect is set to true , in seconds |
connectTimeout | Timeout for establishing a socket connection with the database server, in milliseconds. 0 means never timeout, suitable for JDK 1.4 and higher versions |
socketTimeout | Socket operation (read/write) timeout, in milliseconds. 0 means never timeout |
If you switch to another version of the database, please download the corresponding database connection jar package and place it in the lib folder of the kettle installation folder, then restart kettle.
(Kettle is an application that can be used once extracted, as long as there is a suitable JDK environment.)