1.9. Migrating a MariaDB instance from a previous RHEL version to MariaDB 10.11 on RHEL 10


RHEL 10 provides MariaDB 10.11. If you run a MariaDB 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 MariaDB instance on the RHEL 8 or RHEL 9 host.

Procedure

  1. Install the mariadb-server package:

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

    # systemctl stop mariadb.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 MariaDB 10.11. 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 mariadb service:

    # systemctl enable --now mariadb.service

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

Verification

  • Establish a connection to the MariaDB server:

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

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部