MySQL 8 Cookbook
上QQ阅读APP看书,第一时间看更新

Using YUM repositories

  1. Prepare MySQL for a slow shutdown, which ensures that the undo logs are empty and data files are fully prepared in case of file format differences between releases:
mysql> SET GLOBAL innodb_fast_shutdown = 0;
  1. Shut down the mysql server as described in the Stopping MySQL 8.0 Server section:
shell> sudo systemctl stop mysqld
  1. Remove the InnoDB redo log files (the ib_logfile* files) from the data directory to avoid downgrade issues related to redo log file format changes that may have occurred between releases:
shell> sudo rm -rf /var/lib/mysql/ib_logfile*
  1. Downgrade MySQL. To downgrade the server, you need to uninstall MySQL 8.0, as described in the Uninstalling MySQL 8 section. The configuration files are automatically stored as backup.

    List the available versions:
shell> sudo yum list mysql-community-server

Downgrades are tricky; it is better to remove the existing packages before downgrading:

shell> sudo rpm -qa | grep -i mysql-community | xargs sudo rpm -e --nodeps
warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave

Install the older version:

shell> sudo yum install -y mysql-community-server-<version>