MySQL 8.4.x on Amazon Linux

This article provides a comprehensive guide for installing MySQL version 8.4.x on an Amazon Linux 2023 system. It covers the necessary prerequisites, step-by-step installation process, initial configuration, and performance optimization settings recommended by OvalEdge.

Prerequisites

Ensure the following before proceeding:

  • A user account with sudo privileges

  • A stable internet connection

  • Access to the MySQL VM where the installation will take place

Installation

  1. Update System Packages

    • Log in to the MySQL virtual machine (VM) and run the following command to update the package manager:

      sudo yum update -y

      Sample Reference Screenshot:

  2. Install Required Utilities

  3. Download and Install the MySQL Yum Repository

    • Download the MySQL 8.4 Community Repository RPM package:

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

      Sample Reference Screenshot:

    • Install the repository package:

      sudo yum localinstall -y mysql84-community-release-el9-1.noarch.rpm

      Sample Reference Screenshot:

  4. Install MySQL Server

    • Install the MySQL 8.4.x community server package:

      sudo yum install -y mysql-community-server

      Sample Reference Screenshot:

  5. Start and Enable MySQL Service

    • Start the MySQL service and enable it to start at boot using the following commands:

      sudo systemctl start mysqld
      sudo systemctl enable mysqld
      sudo systemctl status mysqld

      Sample Reference Screenshot:

  6. Retrieve Temporary Root Password

    • MySQL generates a temporary root password upon initial startup. Retrieve it from the log file:

      sudo vi /var/log/mysqld.log

      Sample Reference Screenshot:

    • Search for the line containing temporary password.

  7. Secure MySQL and Set Permanent Root Password

    • Log in to the MySQL shell using the temporary password:

      mysql -u root -p

      Sample Reference Screenshot:

    • Execute the following SQL commands to set a new root password and secure the installation:

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

      Sample Reference Screenshot:

      Replace <new_secure_password> with a strong password that complies with MySQL's password policy.

  8. Configure MySQL Parameters

    • Edit the MySQL configuration file to apply recommended settings:

      sudo vi /etc/my.cnf
    • Add or update the following parameters:

      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:

      • Set bind-address = 0.0.0.0 only if the MySQL server and client applications are on separate machines.

      • Configure innodb_buffer_pool_size to approximately 50–70% of available system RAM for optimal performance.

  9. Restart MySQL Service

    • Apply the configuration changes by restarting the MySQL service:

      sudo systemctl restart mysqld
      sudo systemctl enable mysqld

      Sample Reference Screenshot:

  10. Create OvalEdge Database

    • Once the above steps are completed, download the MasterScripts file provided by the OvalEdge team in the MySQL VM, as shown below.

    • Transfer the MasterScripts SQL file (provided by OvalEdge) to the MySQL virtual machine.

    • Log in to MySQL:

      mysql -u root -p
    • Run the MasterScripts file using the source command:

      source /path/to/MasterScripts.sql;

      Sample Reference Screenshot:

    • Verify the database creation:

      SHOW DATABASES;

      Sample Reference Screenshot:

      Confirm that the ovaledgedb database is listed.


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

Last updated

Was this helpful?