# MySQL 8.4.x on RHEL 8+

This article provides a detailed procedure for installing and configuring MySQL 8.4.x on Red Hat Enterprise Linux (RHEL) 8 or 9 systems. It includes prerequisites, installation steps, initial setup, and recommended performance tuning parameters as per OvalEdge guidelines.

## **Prerequisites**

Ensure the following conditions before starting the installation:

* A virtual machine (VM) or server running RHEL 8.x or 9.x
* A user account with sudo privileges
* An active internet connection is required to download packages
* SELinux and firewall considerations (adjust as per your security policies)

## Installation Steps

1. **System Update**
   * Update the system packages.

     ```bash
     sudo yum update -y
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcY1jaOCtR6KXU4nxU9u7oC6p_EuGMy5RKJChsNFtgd3TZgC6FAQd15CSMQQaUFpZB46LepRkv0AjKmsDl3tILixxyd_Sf0yIbPXftc08z6FilAzp6qg6BErabJmTQcHlZYcZMOtA?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>

2. **Install Required Utilities**
   * Install `yum-utils` to manage repositories.

     ```bash
     sudo yum install -y yum-utils
     ```

3. **Configure MySQL Repository**
   * Download and install the official MySQL 8.4 repository RPM.
   * **For RHEL 8:**

     ```bash
     wget https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm
     sudo rpm -ivh mysql84-community-release-el8-1.noarch.rpm
     ```
   * **For RHEL 9:**

     ```bash
     wget https://dev.mysql.com/get/mysql84-community-release-el9-1.noarch.rpm
     sudo rpm -ivh mysql84-community-release-el9-1.noarch.rpm
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Use the correct <code>.rpm</code> file based on the OS version.</p></div>

     &#x20;\
     \&#xNAN;*Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe8P_nWB7R_S7HIj_jtsFQ_CiuC_4zkSNYyZUBb_WbKQzQYN4sF6tHHFum7GREmYyZkIPClH47d_7VBECMqs0pGoxo-zdckTt3ZXKIFCsdLpYx0Gid0ZxWuDlair81vhU48MZanaw?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>

4. **Disable Default MySQL Module**
   * Disable the default MySQL module to avoid conflicts.

     ```bash
     sudo yum module disable -y mysql
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcsY1TSOIVfTIHIq8LrkR9qImnIw9v58bifCMr0Be9UZTJEB_KrNQzT_P7X0VVdCkMvWuVktidGEv979yDhZRZgCWLt-vu150Rcw8Bx0njUobfdoyAcP_B9S87oUe7-sPur6p1UYw?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>

5. **Install MySQL Server**
   * Install the MySQL community server package.

     ```bash
     sudo yum localinstall -y mysql84-community-release-el8-1.noarch.rpm
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfCQzugKI2TGC-wFXz7vtauyud8cV63MKomIvJkmOu_JiGj23_DZ-XVdbyNeypv7pvSQS71-1TaPxJsTDN84dEEwAi0xbR0hoCes2sXmNCd7gJUsWH6Ks5BRgv-cqtFQcUGK0vcYg?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>

6. **Start and Enable MySQL Service**
   * Start the MySQL service and enable it to run at boot.

     ```bash
     sudo systemctl start mysqld
     sudo systemctl enable mysqld
     sudo systemctl status mysqld
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf_dRyIbMgerDnFAcJGRBY_GVAedig5NmaHhmj6K5fUfKzRucXGNR7JvnZPf3O9-2jKGJPW2gjtI2Sm8ySiz0abl9t3Vx4e4CIJsLC8jBIAuLIdGbgSr9H0zwqV9lnHDT8XZ1fW?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>
   * Verify the installed version:

     ```bash
     mysql --version
     ```

     \
     *Sample Reference Screenshot:*

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXez2H-EeOsfauEzdOXoLkh6pGYdoH94fBQTbKXndskMmcwC3kyHODEtvYFqws-UL_vhB7pJDZcGUz1uiDPl1JGTtrYAjiHQDzmrDCt6Paq5nCbIy1A9xPFK2qq-Pl8e9Pe_Xdbi?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure></div>

7. **Retrieve Temporary Root Password**
   * Check the MySQL log to retrieve the temporary root password.

     ```bash
     sudo grep 'temporary password' /var/log/mysqld.log
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdzH59sJeysbz4DEQufn4TFvxQvqVup6nyrJ-jFXWUibI1XlSX4cJGMZBlQj2J4hZhvNezmom-08GH4Je0T0Wj9ebMxQmqz4nz6Ag20EFw6pIRQqtue9nxJsuyfNq4UEvtz8m4CdQ?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>

8. **Secure MySQL Installation**
   * Log in to MySQL and configure the root account.

     ```bash
     mysql -u root -p
     ```

     \
     *Sample Reference Screenshot:*

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcF1AphA-GtjKWYHVKjxsM2MadK883r6Qyj3-85dOqzfdCjUeFHyxd8FDARL4hXIYwVJrKppOtsLqwF-Of9emq1WfZQJQXIwUTtmCulpovlI1aesOcb5YEldY_Z5TAXkEACAMIAXw?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure></div>
   * Run the following SQL commands:

     ```sql
     ALTER USER 'root'@'localhost' IDENTIFIED BY '<NewSecurePassword>';
     DELETE FROM mysql.user WHERE User='';
     DROP DATABASE IF EXISTS test;
     DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
     FLUSH PRIVILEGES;
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Replace <code>&#x3C;NewSecurePassword></code> with a strong, secure password.</p></div>

     &#x20;\
     \&#xNAN;*Sample Reference Screenshot:*

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcyKIW4mlxPj_wbkUgjhBVItoKdWpN_BBUWWFmmQc6r542T23Ivn-759Ohm2AZaOTY_EO96FwScyNJ9x55YYUsad41q3tPB9056LyfYuMRuMXih8p_YQ5DwVHanGeEdzuX_hFI-2A?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure></div>

9. **Apply Recommended Configuration**
   * Edit the MySQL configuration file:

     ```bash
     sudo vi /etc/my.cnf
     ```
   * Append or update the following parameters:

     ```ini
     max_binlog_size=1G
     binlog_expire_logs_seconds=2592000
     group_concat_max_len=4294967295
     max_connections=600
     max_allowed_packet=1G
     bind-address=0.0.0.0
     innodb_buffer_pool_size=8G
     ```

     \
     *Sample Reference Screenshot:*

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcydscWYwV8SyIs8_qXbWr1OB86q0U2Em98JsgOFGYS1iNPIIKbv2Q4jh31Vn5pAmmM6rQCiPtIx4t2S19LH2NFy6Rh0HFYYuZDs2k5vLYuCPTIGxi-FCgwn3uLROu0_rvmuPW7VQ?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure></div>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><ul><li>Set <code>bind-address=0.0.0.0</code> only if MySQL and the application reside on different VMs.</li><li>Adjust <code>innodb_buffer_pool_size</code> based on system RAM (typically 50%–70%).</li></ul></div>

10. **Restart MySQL Service**
    * Apply the configuration changes by restarting the MySQL service.

      ```bash
      sudo systemctl restart mysqld
      sudo systemctl enable mysqld
      ```

      \
      *Sample Reference Screenshot:*

      <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdzCZ9W60gTR4gjlyM2jhgOILnTlVGpbUxFQmM-XPpIR___wiVbYb1fARy56PAcLq9sR4QeBQ4DgSlI5dgqqJe2SscyKJhA4-LPDNvrYxduj4rAzwLkO2qqpvnWFF6Fiwj6OD_Bcw?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>

### OvalEdge Database Creation

1. **Import OvalEdge Schema**
   * Place the `MasterScripts.sql` file (provided by the OvalEdge team) in the MySQL VM.\
     \
     \&#xNAN;*Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdVh_ACf822cvzUUTX1W6ElHa3sK5CEClkPre6DIdw7pufEug4mFsNHvSF0YF7oAraSo9TdyXCeDhjotZv5ZM1BsZlvv3K4T9dLWdeiTDpM00C-uZro_dN6JeLeMqGnVsFX2wAdOg?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>
   * Connect to MySQL:

     ```bash
     mysql -u root -p
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdA82nk1Yzvm_Rxe-8kbvxYpZe0BHot0l2mqvk5J93gbznQhGOuozmPXIk9OLnBsiYLX1NWTCtTLLXJDteNpwA-RxJyZgB0uLlZih9ZFPLWDX5CQnaQ_kWXO-Svv-GBDxo_EmTd?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure>
   * Run the script:

     ```sql
     SOURCE <path_to_MasterScripts.sql>;
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Replace <code>&#x3C;path_to_MasterScripts.sql></code> with the actual file path.</p></div>

2. **Verify Database Creation**
   * Check if the OvalEdge database has been created:

     ```sql
     SHOW DATABASES;
     ```

     \
     *Sample Reference Screenshot:*

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfwtsMSlH2nArU3CfnXJY-tvs9bOi-RwOjpRurLsjLlZWe3Et3AUrbe_bEsIeDScjAgWS1gSpQAmCtfbFkRb3izeIjFbtXIhw8rzqU_bp4y0SKNzIprsePsAJ9veAI1E1wO7wWgpA?key=e18OpXapHfTQo0RiHjMTRQ" alt=""><figcaption></figcaption></figure></div>
   * Expected output should include:
     * `ovaledgedb`

***

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ovaledge.com/release8.1/deployment-and-maintenance/installation/mysql-8.4.x-on-rhel-8+.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
