Installing MySQL 9.7 LTS Community Edition on CentOS

Installing MySQL 9.7 LTS Community Edition on CentOS

Historically installing MySQL on a RedHat Compatible Linux server was as simple as yum install mysql-server.

Today’s MySQL Oracle Linux, Red Hat Enterprise Linux, CentOS, and Fedora 9.7 instructions are not accurate mixing in 8.4 and 8.0 information, and GenAI can also mislead you for the installation process. The most notable issue that I’d like to resolve is correct GPG Key checking, currently this is disabled --nogpgcheck as 2025 key does not operate as expected.

The following is my cloud-init.yml file I use to build VMs with OrbStack . In summary:

  • Define correct yum repos
  • Install with GPG disabled
  • Enable Service
  • Set a usable (aka non-temporary) root password

cloud-init.yml

#cloud-config
# MySQL 9.7 LTS install for CentOS Stream 9 (works on aarch64/ARM64).
#
# Notes:
#  - The repo URL path is mysql-9.7-community (NOT mysql-9.7-lts-community);
#    only the repo *id* carries the -lts- label.
#  - MySQL's published GPG key file still shows expired (2025-10-22) even
#    though the key was re-extended, and the RPM-GPG-KEY-mysql-2025 URL is
#    empty. So gpgcheck is disabled here to keep an unattended boot from
#    failing. Re-enable once MySQL refreshes the published key file.

write_files:
  - path: /etc/yum.repos.d/mysql-community.repo
    permissions: '0644'
    owner: root:root
    content: |
      [mysql-9.7-lts-community]
      name=MySQL 9.7 LTS Community Server
      baseurl=https://repo.mysql.com/yum/mysql-9.7-community/el/9/$basearch/
      enabled=1
      gpgcheck=0

      [mysql-connectors-community]
      name=MySQL Connectors Community
      baseurl=https://repo.mysql.com/yum/mysql-connectors-community/el/9/$basearch/
      enabled=1
      gpgcheck=0

      [mysql-tools-community]
      name=MySQL Tools Community
      baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/9/$basearch/
      enabled=1
      gpgcheck=0

runcmd:
  - dnf clean all
  - dnf install -y --nogpgcheck mysql-community-server
  - systemctl enable --now mysqld
  - mysql --version
  # Rotate the generated temporary root password to a fresh random one.
  - [ sh, -c, "OLD_PASSWD=$(grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}'); PASSWD=\"#A$(date | md5sum | cut -c1-12)\"; echo \"ALTER USER root@localhost IDENTIFIED BY '${PASSWD}';\" | mysql -uroot -p\"${OLD_PASSWD}\" --connect-expired-password; echo \"${PASSWD}\" > /root/.mysql.password; chmod 600 /root/.mysql.password" ]

Installation Demo

Full installation instructions with orb installed and using mysql97.yml

wget https://gist.githubusercontent.com/ronaldbradford/672ebd49fc0ab0a092f74bec23461ff6/raw/9424a0f8b54b5b79356182aa8f119676cf60280f/mysql97.yml
VM_NAME="centos10"
orb create centos ${VM_NAME} -c mysql97.yml
orb -m ${VM_NAME} tail /var/log/cloud-init-output.log
ssh ${VM_NAME}@orb
PASSWD=$(sudo cat /root/.mysql.password)
mysql -uroot -p${PASSWD} -e "SELECT VERSION()"
Tagged with: MySQL 9.7 Installation

Producing IQR and Outlier statistics with SQL

The interquartile range (IQR) measures the spread of the middle 50% of a distribution — the distance between the first quartile (Q1) and the third quartile (Q3). Combined with Tukey’s 1.

Producing Mode statistics with SQL

The mode is the value or values that appear most frequently in a dataset. Unlike the mean or median, it applies naturally to categorical and ordinal data — star ratings, product codes, survey responses — and reveals what is most common, not what is average.

Extending MySQL Capabilies with UDFs, Plugins and Components - Part 2

MySQL offers three different approaches to extending the SQL capabilities with the default product you download and install. These are: User Defined Function (UDF) MySQL Manual MySQL Plugin MySQL Manual MySQL Component MySQL Manual In my prior post I provided a new uuidv function that accepted a numeric argument to return a string of the version of UUID specified.