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:

      sudo apt update -y

      Sample Reference Screenshot

  2. Download MySQL .deb Package

    • Download the MySQL APT configuration package from the official MySQL website:

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

      Sample Reference Screenshot

  3. Configure MySQL APT Repository

    • Install the downloaded package. During installation, select MySQL 8.4 when prompted:

      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

      Sample Reference Screenshot 02

      Select MySQL and click OK as shown in the screenshots above.

  4. Update Repository Information

    • Refresh the package list to include the MySQL APT repository:

      sudo apt update -y

      Sample Reference Screenshot

  5. Install MySQL Server

    • Install the MySQL server package:

      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.

      Sample Reference Screenshot 01

      Sample Reference Screenshot 02

      Sample Reference Screenshot 03

  6. Verify Installation

    • Check the MySQL version:

      mysql --version
    • Connect to the MySQL shell:

      mysql -u root -p
    • Exit the MySQL shell:

      exit;

      Sample Reference Screenshot

  7. Update MySQL Configuration Parameters

    • Open the MySQL server configuration file:

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

      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

      Set bind-address=0.0.0.0 only if the MySQL server must accept remote connections (e.g., from an external application server).

      Adjust innodb_buffer_pool_size based on available memory. The recommended value is 50–70% of the total RAM.

      Sample Reference Screenshot

  8. Restart and Enable MySQL Service

    • Apply the new configuration by restarting the MySQL service:

      sudo systemctl restart mysql
      sudo systemctl enable mysql

      Sample Reference Screenshot

OvalEdge Database Initialization

  1. 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):

      wget <Master_scripts_URL>

      Sample Reference Screenshot

  2. Execute MasterScripts

    • Log in to MySQL:

      mysql -u root -p

      Sample Reference Screenshot

    • Within the MySQL prompt, run:

      source <Path of MasterScripts file>
    • Exit the MySQL shell:

      exit;

  1. Verify Database Creation

  • Reconnect to MySQL:

    mysql -u root -p
  • Check that the required databases are created:

    SHOW DATABASES;

    Sample Reference Screenshot

    The presence of the ovaledgedb confirms successful database initialization.


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

Last updated

Was this helpful?