Chapter 8. Stop the MariaDB Service and Prepare the Directories


The procedure requires stopping the MariaDB service and making a copy of the directories in case of data directory corruption. The copy of the directories is useful for root-cause-analysis investigation. Perform the following procedure on ALL nodes.

Procedure

  1. Stop the MariaDB service on ALL controller nodes.

    [root@overcloud-controller-0] mysqladmin -u root shutdown
    Copy to Clipboard Toggle word wrap
  2. Move the existing mariadb data directories and prepare new data directories on ALL controller nodes.

    [root@overcloud-controller-0] mv /var/lib/mysql /var/lib/mysql-save
    [root@overcloud-controller-0] mkdir /var/lib/mysql
    [root@overcloud-controller-0] chown mysql:mysql /var/lib/mysql
    [root@overcloud-controller-0] chmod 0755 /var/lib/mysql
    [root@overcloud-controller-0] mysql_install_db --datadir=/var/lib/mysql --user=mysql
    [root@overcloud-controller-0] chown -R mysql:mysql /var/lib/mysql/
    [root@overcloud-controller-0] restorecon -R /var/lib/mysql
    Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat