Upgrade using the Percona repositories¶
We recommend using the Percona repositories to upgrade your server.
Find the instructions on how to enable the repositories in the following documents:
If you used the TokuDB storage engine in Percona Server for MySQL 5.7, we recommend that you migrate to either MyRocks or InnoDB, verify the migration, and then upgrade to 8.0. Percona Server for MySQL 8.0.29 removed the TokuDB storage engine.
Run the following commands as root or use the sudo
command.
-
Make a full backup (or dump if possible) of your database. Move the database configuration file,
my.cnf
, to another directory to save it. If the configuration file is not moved, it can be overwritten. -
Stop the server with the appropriate command for your system:
systemctl stop mysql`
-
Modify the database configuration file,
my.cnf
, as needed. -
Install Percona Server for MySQL:
$ sudo apt update $ sudo apt install curl $ curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb $ sudo apt install gnupg2 lsb-release ./percona-release_latest.generic_all.deb $ sudo apt update $ sudo percona-release setup ps80 $ sudo apt install percona-server-server
-
Install the storage engine packages.
Percona Server for MySQL 8.0.28-19 removes TokuDB. For more information, see TokuDB Introduction.
If you used the TokuDB storage engine in Percona Server for MySQL 5.7, we recommend that you migrate to either MyRocks or InnoDB, verify the migration, and then upgrade to 8.0.
If you used the MyRocks storage engine in Percona Server for MySQL 5.7, install the
percona-server-rocksdb
package:$ sudo apt install percona-server-rocksdb
-
Running the upgrade:
Starting with Percona Server for MySQL 8.0.16-7,
mysql_upgrade
is deprecated. After this version, no operation occurs and this utility generates a message. The mysqld binary automatically runs the upgrade process if needed.To find more information, see MySQL Upgrade Process Upgrades
If you are upgrading to a Percona Server for MySQL version before 8.0.16-7, the installation script does not automatically run
mysql_upgrade
. Runmysql_upgrade
manually.$ mysql_upgrade
Expected output
Checking if update is needed. Checking server version. Running queries to upgrade MySQL server. Checking system database. mysql.columns_priv OK mysql.db OK mysql.engine_cost OK ... Upgrade process completed successfully. Checking if update is needed.
-
Restart the service
$ sudo systemctl restart mysqld
After the service has been successfully restarted you can use the new Percona Server for MySQL 8.0.
Run the following commands as root or use the sudo command.
-
Make a full backup (or dump if possible) of your database. Copy the database configuration file, for example,
my.cnf
, to another directory to save it. -
Stop the server with the appropriate command for your system:
$ systemctl stop mysql`
-
Check your installed packages with
rpm -qa | grep Percona-Server
. -
Remove the packages without dependencies. This command only removes the specified packages and leaves any dependent packages. The command does not prompt for confirmation:
$ rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
It is important to remove the packages without dependencies as many packages may depend on these (as they replace
mysql
) and will be removed if omitted.To remove the listed packages, run:
$ rpm -qa | grep '^mysql-' | xargs rpm -e --nodeps
-
Install the
percona-server-server
package:{.bash data-prompt="$"} $ sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm $ sudo percona-release setup ps80 $ sudo yum install percona-server-server
-
Install the storage engine packages. Percona Server for MySQL 8.0.28-19 removes TokuDB. For more information, see TokuDB Introduction.
If you used the TokuDB storage engine in Percona Server for MySQL 5.7, we recommend that you migrate to either MyRocks or InnoDB, verify the migration, and then upgrade to 8.0.
If you used the MyRocks storage engine in Percona Server for MySQL 5.7, install the
percona-server-rocksdb
package:$ yum install percona-server-rocksdb
-
Modify your configuration file,
my.cnf
, and reinstall the plugins if necessary. -
Running the upgrade
Starting with Percona Server for MySQL 8.0.16-7,
mysql_upgrade
is deprecated. After this version, no operation occurs and this utility generates a message. The mysqld binary automatically runs the upgrade process if needed.To find more information, see MySQL Upgrade Process Upgrades
If you are upgrading to a Percona Server for MySQL version before 8.0.16-7, you can start the mysql service using
service mysql start
. Usemysql_upgrade
to migrate to the new grant tables. Themysql_upgrade
rebuilds the required indexes and does the required modifications:$ mysql_upgrade
-
Restart the service.
$ systemctl mysql restart`.
After the service has been successfully restarted you can use the Percona Server for MySQL 8.0.
Get expert help¶
If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services.