Rechercher

3.5. Migrating to a RHEL 9 version of MySQL 8.0

download PDF

RHEL 8 contains the MySQL 8.0, MariaDB 10.3, and MariaDB 10.5 implementations of a server from the MySQL databases family. RHEL 9 provides MySQL 8.0 and MariaDB 10.5.

This procedure describes migration from a RHEL 8 version of MySQL 8.0 to a RHEL 9 version of MySQL 8.0 using the mysql_upgrade utility. The mysql_upgrade utility is provided by the mysql-server package.

Conditions préalables

  • Before performing the upgrade, back up all your data stored in the MySQL databases. See Backing up MySQL data.

Procédure

  1. Ensure that the mysql-server package is installed on the RHEL 9 system:

    # dnf install mysql-server
  2. Ensure that the mysqld service is not running on either of the source and target systems at the time of copying data:

    # systemctl stop mysqld.service
  3. Copy the data from the source location to the /var/lib/mysql/ directory on the RHEL 9 target system.
  4. Set the appropriate permissions and SELinux context for copied files on the target system:

    # restorecon -vr /var/lib/mysql
  5. Ensure that mysql:mysql is an owner of all data in the /var/lib/mysql directory:

    # chown -R mysql:mysql /var/lib/mysql
  6. Start the MySQL server on the target system:

    # systemctl start mysqld.service

    Note: In earlier versions of MySQL, the mysql_upgrade command was needed to check and repair internal tables. This is now done automatically when you start the server.

Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.