Methods and steps to upgrade MySql5.x to MySql8.x

Methods and steps to upgrade MySql5.x to MySql8.x

Several Differences Between MySQL 5.x and MySQL 8.0.X

The differences in application.properties are commented out and correspond to the 8.0.x version.

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
//spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.username=root //Your username. Default is root
spring.datasource.password=123456//Your password. Default is root

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/sell?characterEncoding=utf-8&useSSL=false
//spring.datasource.url=jdbc:mysql://127.0.0.1:3306/sell?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=UTC

spring.jpa.show-sql=true

server.context-path=/sell
//server.servlet.context-path=/sell

Upgrading MySql5.x to MySql8.x is very simple. Generally speaking, it only takes two steps.

1. Replace the new jar package

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

2. Replace the new driver class

com.mysql.cj.jdbc.Driver

3. Replace the new URL connection and specify the time zone

# Set the time to GMT8 serverTimezone=GMT%2B8

# Full URL
String url="jdbc:mysql://"+dbHost+":"+dbPort+"/"+dbName+"?"
    + "serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8"
    + "&port="+dbPort+"&autoReconnect=true";

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Upgrade Docker version of MySQL 5.7 to MySQL 8.0.13, data migration
  • MySQL 8.0 upgrade experience

<<:  How to implement Ajax concurrent request control based on JS

>>:  Sample code for implementing rolling updates of services using Docker Swarm

Recommend

Example of how to implement local fuzzy search function in front-end JavaScript

Table of contents 1. Project Prospects 2. Knowled...

Example of how to implement MySQL cascading replication

The so-called cascading replication is that the m...

Six weird and useful things about JavaScript

Table of contents 1. Deconstruction Tips 2. Digit...

Example of how to enable Slow query in MySQL

Preface Slow query log is a very important functi...

React's method of realizing secondary linkage

This article shares the specific code of React to...

docker cp copy files and enter the container

Enter the running container # Enter the container...

WeChat applet realizes simple tab switching effect

This article shares the specific code for WeChat ...

MySQL 5.7.31 64-bit free installation version tutorial diagram

1. Download Download address: https://dev.mysql.c...

Unicode signature BOM detailed description

Unicode Signature BOM - What is the BOM? BOM is th...

Example analysis of the usage of the new json field type in mysql5.7

This article uses an example to illustrate the us...

JavaScript to achieve stair rolling special effects (jQuery implementation)

I believe everyone has used JD. There is a very c...

Example code for using HTML ul and li tags to display images

Copy the following code to the code area of ​​Drea...

Use thead, tfoot, and tbody to create a table

Some people use these three tags in a perverted wa...

How to modify the port mapping of a running Docker container

Preface When docker run creates and runs a contai...