MySQL5.7+ / MySQL8.0+ / MySQL5.7+ / MySQL8.0+

background

I mainly studied MySQL and SpringFramework before, but now I study MyBatis, which belongs to ORM Framework. One of its extremely important roles is to build a bridge between database (especially MySQL) and SpringFramework. For business projects, MyBatis successfully interacts with databases (such as MySQL) as a database class, which perfectly interprets the vision that everything can be encapsulated into classes for interaction.

When the author was engaged in an e-commerce project, the data was deployed on different servers by means of database and table division. However, due to the demand of linked tables between tables, the author was faced with whether to carry out linked tables at the server end or in the database. As the database is very easy to become a bottleneck, so the joint table operation is carried out on the server side, which means that the operation of the database is basically a simple single table add, delete, change and query, so the mybatis -generator-Maven-plugin is used to generate the code.

So, when I started to learn MyBatis, I realized I didn’t know anything about it hahaha, when running the project, usually the warning has no effect, but this warning is a little interesting, let’s have a look.

Tue Apr 27 17:42:23 CST 2021 WARN: Establishing SSL connection without 
server'identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL Connection must be established by default if explicit option isn't set. For compliance with 
existing applications not using SSL the verifyServerCertificate property 
is set to 'false'. You need either to explicitly disable SSL by setting 
useSSL=false, or set useSSL=true and provide truststore for server 
certificate verification.
Copy the code

English is not very good friends can read my translation:

It is not recommended to establish an SSL connection without the server’s authentication setup. If the MySQL5.5.45+, 5.6.26+ and 5.7.6+ Settings are not specified, an SSL connection is required by default. To be compatible with existing applications that do not use SSL, the authentication server certificate property should be set to false. You can either make it unavailable by explicitly setting useSSL=false, or you can set useSSL=true and provide a truststore for server certificate validation.

The solution

You are explicitly told the solution in the warning.

Set useSSL=false value=” JDBC :mysql:// localhost:3306/mybatis? UseSSL = false “.

Set useSSL=true and provide a truststore for server certificate validation.

If you are using MySQL5.5.45+, 5.6.26+ and 5.7.6+, you do not need to set it because it will establish SSL connections by default.

extension

The most valuable part of this question, however, is to realize that MySQL has suddenly made a huge leap from 5.7 to 8.0. It feels like Huawei’s Mate10 has suddenly become Mate20. There must be some knowledge to explore. Let’s have a look together.

Oracle explains as follows:

Due to the many new and important features we were introducing in this MySQL version, we decided to start a fresh new series. As the series numbers 6 and 7 had actually been used before by MySQL, we went to 8.0.

Well, it says that sequences 6 and 7 have already been used, right? Yes, if you look closely at the 5.+ release above, you can see that there are 5.6.+ and 5.7.+, and this release adds many important and new features, so we started with 8.0.

So what new and important features have been added?

Mysql8.0. + added new features

1. Added window functions

Supporting window functions is a common user request, but what are window functions? Window functions are a bit like aggregate functions such as SUM() and COUNT(), but instead of merging the multi-row query results into one row, they put the results back into multiple rows. In other words, window functions do not need GROUP BY.

These are the window functions supported by MySQL: COUNT, SUM, AVG, MIN, MAX, BIT_OR, BIT_AND, BIT_XOR, STDDEV_SAMP, and VAR_SAMP. Have interest oneself check next ha!

2, support descending index

Before mysql8.0.+, descending indexes were implemented through forward + backward queries. The first advantage is that a sequential traversal lookup is faster than a backward lookup, and the second advantage is that indexes are used when ASC/DESC sorting is required.

3. Improved reliability

  • MySQL8.0 stores its metadata in InnoDB, a proven transaction storage engine. System tables (such as users and permissions) and data dictionaries are represented in InnoDB.

  • MySQL8.0 eliminates a potential source of inconsistency. Since MySQL follows the architectural pattern of unified Server layer + different underlying engine plug-ins, FRM files are created for each table in the Server layer to store metadata information related to table definitions. However, some engines (such as InnoDB) store metadata themselves, which not only creates metadata redundancy, but because the Server layer and the engine layer are managed separately, it is difficult to crash-safe when performing operations such as DDL, let alone make DDL transactional. To address these issues (especially DDL’s inability to be atomic), FRM files and other server layer metadata files (FRM, PAR, TRN, TRG, ISL,db.opt) were cancelled starting with MySQL8.0. All metadata is stored in the InnoDB engine, and other system tables such as permission tables are also used in the InnoDB engine.

  • MySQL 8.0 ensures atomic crash safety DDL. With this, the user guarantees that any DDL statement will be fully executed. This is especially important in a replicated environment, where master/slave (nodes) may be out of sync, resulting in data drift.

Because really added many features, but usually basic use, so please interested friends to see the reference link, there is a more detailed description.

Reference links:

1, What’s New in MySQL 8.0? (Generally Available).

MySQL 8.0 FAQ: General

This article is part of the “Gold Nuggets For Free!” Event, click to view details of the event