Notes on matching MySql 8.0 and corresponding driver packages

Notes on matching MySql 8.0 and corresponding driver packages

MySql 8.0 corresponding driver package matching

After the MySql database is updated to version 8.0 or above, the corresponding application database link driver package must also be updated to version 8.0. Otherwise, a driver exception will be reported.

A few points to note:

1. The latest driver package Maven download configuration is as follows:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>

2. The JDBC configuration table is updated as follows:

Previous Versions

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://xxx.xx.xx.xxx:3306/db?characterEncoding=utf-8
jdbc.username=root
jdbc.password=admin

Current version

  • jdbc.driver = com.mysql.cj.jdbc.Driver
  • jdbc.url=jdbc:mysql://xxx.xx.xx.xxx:3306/db? useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
  • jdbc.username=root
  • jdbc.password=ad

Pay attention to the red part, this is where the changes need to be made. After that, you can use the 8.0 version of MySql.

MySql 8.0 version driver replacement

The driver of MySQL 8.0 needs to be changed to "com.mysql.cj.jdbc.Driver". The previous "com.mysql.jdbc.Driver" can no longer be used in MySQL 8.0. The official document link is: https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-api-changes.html;

In addition, it is recommended to update mysql-connector-java to version 8.0 (https://dev.mysql.com/downloads/connector/j/).

In summary, the following two points are modified:

1. Update the mysql-connector-java version:

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>

2. Replace the driver:

<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/test?
useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false" userId="root" password="root"/>

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • WebLogic cluster and configuration graphic method
  • A simple example of connecting to Oracle/MySQL database using Java [with Oracle+MySQL database driver package]
  • WebLogic service establishes data source connection test and updates MySQL driver package

<<:  Detailed explanation of inline-block layout implementation of CSS display attribute

>>:  Introduction to the use of html area image hotspots with a list of related properties

Recommend

Two examples of using icons in Vue3

Table of contents 1. Use SVG 2. Use fontAwesome 3...

Recommend a cool interactive website made by a front-end engineer

Website link: http://strml.net/ By Samuel Reed Ti...

nginx proxy_cache batch cache clearing script introduction

Preface: I used the official nginx proxy_cache as...

HTML meta explained

Introduction The meta tag is an auxiliary tag in ...

Ubuntu regularly executes Python script example code

Original link: https://vien.tech/article/157 Pref...

Detailed explanation of Vue's ref attribute

Summarize This article ends here. I hope it can b...

MySQL Database Iron Laws (Summary)

Good database specifications help reduce the comp...

Detailed explanation of how to use zabbix to monitor oracle database

1. Overview Zabbix is ​​a very powerful and most ...

mysql security management details

Table of contents 1. Introduce according to the o...

43 Web Design Mistakes Web Designers Should Watch Out For

This is an article about website usability. The a...

JS asynchronous execution principle and callback details

1. JS asynchronous execution principle We know th...

Eight implementation solutions for cross-domain js front-end

Table of contents 1. jsonp cross-domain 2. docume...

Example code of how to create a collapsed header effect using only CSS

Collapsed headers are a great solution for displa...