Install MySQL

RHEL 10 provides MySQL 8.4 as the initial version of the Application Stream, which can install as an RPM package. In minor releases of RHEL 10, Red Hat provides additional MySQL versions as application streams with a shorter life cycle.

About this task

Note

By design, you can install only one version (stream) of the same application stream and, because of conflicting RPM packages, you cannot install MariaDB and MySQL on the same host. As an alternative, you can run the database server services in a container. See Using containers to run multiple MariaDB and MySQL instances on a single host.

Procedure

  1. Install MySQL server packages:
    # dnf install mysql8.4-server
  2. Enable and start the mysqld service:
    # systemctl enable --now mysqld.service
  3. Improve the security after the installation:
    $ mysql_secure_installation

    The command launches a fully interactive script, which prompts for each step in the process. The script enables you to improve security in the following ways:

    • Setting a password for root accounts
    • Removing anonymous users
    • Disallowing remote root logins (outside the local host)