Let us understand how to downgrade binary and package-based installation on Unix or Linux. Downgrading binary and package based installations on Unix or Linux can be done in a variety of ways. They have discussed below.
In-place downgrade involves shutting down the new MySQL version.
Once this is done, the new MySQL binaries or packages are replaced with the old binaries or packages.
Once this is done, the old MySQL version is restarted on the existing data directory.
MySQL has to be configured to perform a slow shutdown by setting innodb_fast_shutdown to 0.
The below command would do the same −
mysql -u root -p --execute="SET GLOBAL innodb_fast_shutdown=0"
Shut down the newer MySQL server. This can be done using the below commands −
mysqladmin -u root -p shutdown
After the slow shutdown, the InnoDB redo log files are removed (the ib_logfile* files) from the data directory. This is done to avoid downgrade issues that are associated with the redo log file format which would have occurred between releases.
Logical downgrade involves usage of mysqldump to dump all tables from the new MySQL version.
Once this is done, the dump file is loaded into the old MySQL version.
Logical downgrades are supported for downgrades between releases within the same release series as well as for downgrades to the previous release level.
Only downgrades between General Availability (GA) releases are supported.
Dump all the databases. This is done using the below command −
mysqldump −u root −p −−add−drop−table −−routines −−events −−all−databases −−force > data−for−downgrade.sql
The newer MySQL server is shut down using the below command −
mysqladmin −u root −p shutdown