
上QQ阅读APP看书,第一时间看更新
Logical Downgrades
Here is an outline of the steps:
- Export existing data from the MySQL 8.0 version using logical backup (refer to Chapter 7, Backups for logical backup methods)
- Install MySQL 5.7
- Load the dump file into the MySQL 5.7 version (refer to Chapter 8, Restoring Data for restoring methods)
- Run the mysql_upgrade utility
Here are the detailed steps:
- You need to take logical backup of the database. (refer to Chapter 7, Backups for a quicker backup called mydumper):
shell> mysqldump -u root -p --add-drop-table --routines --events --all-databases --force > mysql80.sql
- Shut down the MySQL server as described in the Starting or Stopping MySQL 8 section.
- Move the data directory. Instead of restoring the SQL backup (in step 1), we can move back the data directory if you want to keep MySQL 8:
shell> sudo mv /var/lib/mysql /var/lib/mysql80
- Downgrade MySQL. To downgrade the server, we need to uninstall MySQL 8. The configuration files are automatically backed up.