# MySQL 8.4.x on Ubuntu 22.04+

This article provides a step-by-step guide to installing **MySQL version 8.4.x** on Ubuntu 22.04. It outlines the prerequisites, installation procedure, initial configuration, and tuning parameters recommended by OvalEdge to optimize database performance and compatibility.\
This guide is intended for **system administrators, DevOps engineers, and database administrators** deploying MySQL in enterprise environments.

## Prerequisites

Before beginning the installation, ensure the following system and environment requirements are met:

1. **Operating System**: Ubuntu 22.04 LTS or later
2. **Privileges**: A user account with `sudo` privileges
3. **Network**: Stable internet connectivity on the target VM
4. **Resources**: Minimum 4 GB RAM (8 GB+ recommended for production)
5. **Repository Access**: Outbound access to `https://dev.mysql.com`

## Installation Steps

1. **Update System Packages**
   * Refresh the system package index to ensure the latest repository metadata is available:

     ```bash
     sudo apt update -y
     ```

     \
     *Sample Reference Screenshot*

     <figure><img src="/files/Ojewy4fu1zWJws58MIaI" alt=""><figcaption></figcaption></figure>

2. **Download MySQL .deb Package**
   * Download the MySQL APT configuration package from the official MySQL website:

     ```bash
     wget https://dev.mysql.com/get/mysql-apt-config_0.8.34-1_all.deb
     ```

     \
     *Sample Reference Screenshot*

     <figure><img src="/files/WWtuKSo1sgQmBiuDxgcR" alt=""><figcaption></figcaption></figure>

3. **Configure MySQL APT Repository**
   * Install the downloaded package. During installation, select **MySQL 8.4** when prompted:

     ```bash
     sudo dpkg -i mysql-apt-config_0.8.34-1_all.deb
     ```
   * Use arrow keys and *Enter* to navigate and confirm selections in the package configuration UI.

     \
     *Sample Reference Screenshot 01*

     <figure><img src="/files/dfGgd4u1tWVlHDXxrxO7" alt=""><figcaption></figcaption></figure>

     \
     \&#xNAN;*Sample Reference Screenshot 02*

     <figure><img src="/files/ST2B8XCL3e0C44V1nths" alt=""><figcaption></figcaption></figure>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Select MySQL and click OK as shown in the screenshots above.</p></div>

4. **Update Repository Information**
   * Refresh the package list to include the MySQL APT repository:

     ```bash
     sudo apt update -y
     ```

     \
     *Sample Reference Screenshot*

     <figure><img src="/files/a6z1Eck7SxsdDki76279" alt=""><figcaption></figcaption></figure>

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

     ```bash
     sudo apt-get install mysql-server -y
     ```
   * During installation, the system will prompt for the **root password**. Set and confirm the password as per organizational policy.<br>

     *Sample Reference Screenshot 01*

     <figure><img src="/files/VzPgzBWsXNEPNaHgUBhl" alt=""><figcaption></figcaption></figure>

     \
     \&#xNAN;*Sample Reference Screenshot 02*

     <figure><img src="/files/mo0RAm80sQqB5jZ96zLY" alt=""><figcaption></figcaption></figure>

     \
     \&#xNAN;*Sample Reference Screenshot 03*

     <figure><img src="/files/2dHTm38mQiR6Y5KtAy9t" alt=""><figcaption></figcaption></figure>

6. **Verify Installation**
   * Check the MySQL version:

     ```bash
     mysql --version
     ```
   * Connect to the MySQL shell:

     ```bash
     mysql -u root -p
     ```
   * Exit the MySQL shell:

     ```sql
     exit;
     ```

     \
     *Sample Reference Screenshot*

     <div align="left"><figure><img src="/files/n6BA4IKCwE2fc4LOFbZc" alt=""><figcaption></figcaption></figure></div>

7. **Update MySQL Configuration Parameters**
   * Open the MySQL server configuration file:

     ```bash
     sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
     ```
   * Add or update the following parameters under the `[mysqld]` section:

     ```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
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Set <code>bind-address=0.0.0.0</code> <strong>only if</strong> the MySQL server must accept remote connections (e.g., from an external application server).</p></div>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Adjust <code>innodb_buffer_pool_size</code> based on available memory. The recommended value is <strong>50–70% of the total RAM</strong>.</p></div>

     \
     *Sample Reference Screenshot*

     <div align="left"><figure><img src="/files/VOzNEv4pJxFh3t2vLy3T" alt=""><figcaption></figcaption></figure></div>

8. **Restart and Enable MySQL Service**
   * Apply the new configuration by restarting the MySQL service:

     ```bash
     sudo systemctl restart mysql
     sudo systemctl enable mysql
     ```

     \
     *Sample Reference Screenshot*

     <figure><img src="/files/gtY80isGtwDVv3hnBQ5H" alt=""><figcaption></figcaption></figure>

### OvalEdge Database Initialization

9. **Download MasterScripts**
   * Transfer the **MasterScripts SQL file** provided by OvalEdge to the MySQL VM. Use `scp`, `wget`, or other secure transfer methods.

     Example (using wget):

     ```bash
     wget <Master_scripts_URL>
     ```

     \
     *Sample Reference Screenshot*

     <figure><img src="/files/yOy7ZFyHaaHctOwkPM6W" alt=""><figcaption></figcaption></figure>

10. **Execute MasterScripts**
    * Log in to MySQL:

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

      \
      \&#xNAN;*Sample Reference Screenshot*

      <figure><img src="/files/O7Jip0tw3jyNaivdfCrH" alt=""><figcaption></figcaption></figure>
    * Within the MySQL prompt, run:

      ```sql
      source <Path of MasterScripts file>
      ```
    * Exit the MySQL shell:

      ```sql
      exit;
      ```

11. **Verify Database Creation**

* Reconnect to MySQL:

  ```bash
  mysql -u root -p
  ```
* Check that the required databases are created:

  ```sql
  SHOW DATABASES;
  ```

  \
  *Sample Reference Screenshot*

  <div align="left"><figure><img src="/files/wcx1iRtDIOuaWUIfT9Yk" alt=""><figcaption></figcaption></figure></div>

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The presence of the <code>ovaledgedb</code> confirms successful database initialization.</p></div>

***

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-ubuntu-22.04+.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.
