MySql 8.0 on OEL 7.9
Install and configure MySQL 8.0 on Oracle Enterprise Linux 7.9.
This article demonstrates MySQL 8.0.31 installation on OEL 7.9 version.
Now, we will use WGET utility to download the RPM.
wget https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm
Adding the MySQL Yum Repository
yum install -y mysql80-community-release-el7-7.noarch.rpm
Installing MySQL
yum install mysql-community-server -y
Start MySQL service and enable it to auto-start on reboot
# chkconfig mysqld on
# service mysqld start
Start the MySQL server with the following command:
# systemctl start mysqld
You can check the status of the MySQL server with the following command:
# systemctl status mysqld
A superuser account 'root'@'localhost' is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command
# grep 'temporary password' /var/log/mysqld.log
Change the root password as soon as possible by logging in with the generated, temporary password and set a custom password for the superuser account:
# mysql -uroot -p
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssword123';
Create MySQL Database
Once MySQL installation is done, let us connect to the database
Use the below command to create a new database
mysql> create database mydb;
List all the databases
mysql> show databases;
To switch between databases use the below command
mysql> exit
You can make new connections directly to the database as follows.
$ mysql --user=root --database=mydb --password
Enter password:
Installation Done!