2.9. Migrating a MySQL instance from a previous RHEL version to MySQL 8.4 on RHEL 10


RHEL 10 provides MySQL 8.4. If you run a MySQL instance on a previous RHEL version, you can set up RHEL 10 on a new host and migrate the instance to it.

Prerequisites

  • You set up RHEL 10 on a new host.
  • You performed a file system backup of the MySQL instance on the RHEL 8 or RHEL 9 host.

Procedure

  1. Install the mysql8.4-server package:

    # dnf install mysql8.4-server
  2. Stop the service if it is already running:

    # systemctl stop mysqld.service
  3. Copy the content of the /var/lib/mysql/ directory from the previous host to the same location on the RHEL 10 host.
  4. Copy the configuration files from the previous host to the /etc/my.cnf.d/ directory, and ensure that the files includes only options valid for MySQL 8.4. For details, see the upstream documentation.
  5. Restore the SELinux context:

    # restorecon -rv /var/lib/mysql/
    # restorecon -rv /etc/my.cnf.d/
  6. Ensure the correct ownership of /var/lib/mysql/ and its subdirectories:

    # chown -R mysql:mysql /var/lib/mysql/
  7. Enable and start the mysqld service:

    # systemctl enable --now mysqld.service

    When the service starts, MySQL automatically checks, repairs, and updates internal tables.

Verification

  • Establish a connection to the MySQL server:

    # mysql -u root -p -h <hostname>
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部