Installing MySQL 8 on Oracle Linux 8 - nsojunior/mysql-general Wiki

Hello!

This is quick doc on the steps to install MySQL on Oracle Linux 8.

Official documentation is available at: https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/

To install using Yum repository we can follow: https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/linux-installation-yum-repo.html

Below quick step by step:

  1. Go to web page https://dev.mysql.com/downloads/repo/yum/ and download to the version you want to install or just copy the link to the RPM file
  2. Run the following command to install the Yum repository: sudo sudo yum -y install [rpm file url], for me it is sudo yum -y install https://dev.mysql.com/get/mysql80-community-release-el8-4.noarch.rpm
  3. For MySQL 8 installation on Oracle Linux 8, we must disable the default MySQL Module with the command: sudo yum -y module disable mysql
  4. Now let's install MySQL 8 running the command sudo yum -y install mysql-community-server
  5. Start mysql running the command sudo systemctl start mysqld
  6. Check mysql process status: systemctl status mysqld
  7. Get temporary root password in mysql log file: sudo grep 'temporary password' /var/log/mysqld.log
  8. Log in MySQL using the command mysql -uroot -p and provide the temporary password
  9. Change root user password running this SQL command in mysql client ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

You are done!