Databases 7 min read

Guide to Upgrading MySQL from 5.7 to 8.0

This article provides a comprehensive step‑by‑step guide for DBAs to safely upgrade MySQL from version 5.7 to 8.0, covering motivations, compatibility checks, new features, preparation tasks, upgrade commands, post‑upgrade verification, and rollback considerations.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Guide to Upgrading MySQL from 5.7 to 8.0

MySQL 8.0 offers improved security, performance, stability, and new features such as hash joins, window functions, instant DDL, and enhanced JSON support, making it a compelling upgrade target for DBAs.

Before upgrading, administrators should verify dictionary upgrades (e.g., password authentication changes), keyword and SQL compatibility, storage engine formats, application compatibility, and password policies.

Key new features and deprecated/removed items are listed in the official MySQL documentation, and the upgrade process can be assisted by MySQL Shell utilities.

Preparation steps include testing upgrades in a sandbox, backing up data, adjusting my.cnf, identifying incompatible operations, planning a phased rollout (e.g., upgrading a replica first), estimating downtime, and defining rollback procedures.

Pre‑upgrade checks can be performed with MySQL Shell, for example:

#mysqlsh root:[email protected]:3410 -e 'util.checkForServerUpgrade({"targetVersion":"8.0.19","configPath":"/etc/my3410.cnf"})';

During the upgrade, the mysql_upgrade client is deprecated; the server now handles necessary upgrades when started with the new binaries. Ensure a clean shutdown by setting innodb_fast_shutdown=0, then back up the data.

Start the new MySQL 8.0 server:

[root@ss30 bin]# /opt/mysql8.0.19/bin/mysqld_safe --defaults-file=/etc/my3400.cnf --user=mysql &

Verify the server is running and check the version:

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.19    |
+-----------+

Confirm no MyISAM tables remain and that all engines are InnoDB. After verification, perform application testing to ensure normal operation.

The article concludes that a successful upgrade requires thorough planning, testing, backup, and validation, after which teams can begin leveraging MySQL 8.0’s new capabilities.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

migrationperformancedatabasemysqlSecurityupgrade
Full-Stack Internet Architecture
Written by

Full-Stack Internet Architecture

Introducing full-stack Internet architecture technologies centered on Java

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.