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

Detailed tutorial on MySql installation and uninstallation

This article shares the tutorial of MySql install...

Summary of MySQL 8.0 memory-related parameters

Theoretically, the memory used by MySQL = global ...

Details of MutationObServer monitoring DOM elements in JavaScript

1. Basic Use It can be instantiated through the M...

MySQL date functions and date conversion and formatting functions

MySQL is a free relational database with a huge u...

How to implement responsive layout in vue-cli

When we are doing front-end development, we will ...

Some notes on mysql create routine permissions

1. If the user has the create routine permission,...

js method to realize shopping cart calculation

This article example shares the specific code of ...

Steps for Vue3 to use mitt for component communication

Table of contents 1. Installation 2. Import into ...

How to create a child process in nodejs

Table of contents Introduction Child Process Crea...

Example usage of Linux compression file command zip

The ".zip" format is used to compress f...

Practical record of vue using echarts word cloud chart

echarts word cloud is an extension of echarts htt...

MySQL 5.6.28 installation and configuration tutorial under Linux (Ubuntu)

mysql5.6.28 installation and configuration method...

What is jQuery used for? jQuery is actually a js framework

Introduction to jQuery The jQuery library can be ...

Detailed explanation of Promises in JavaScript

Table of contents Basic usage of Promise: 1. Crea...