MySql 8.0 on OEL 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
![](https://static.wixstatic.com/media/cb6190_5d976d7254894b3f8c92d93a9bce2513~mv2.png/v1/fill/w_49,h_16,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_5d976d7254894b3f8c92d93a9bce2513~mv2.png)
Adding the MySQL Yum Repository
yum install -y mysql80-community-release-el7-7.noarch.rpm
![](https://static.wixstatic.com/media/cb6190_53b9a073e3e0415ea6bb730e6c6c90b9~mv2.png/v1/fill/w_49,h_10,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_53b9a073e3e0415ea6bb730e6c6c90b9~mv2.png)
Installing MySQL
yum install mysql-community-server -y
![](https://static.wixstatic.com/media/cb6190_7bc64138bc074ac6a88e73c6541415e0~mv2.png/v1/fill/w_49,h_19,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_7bc64138bc074ac6a88e73c6541415e0~mv2.png)
Start MySQL service and enable it to auto-start on reboot
# chkconfig mysqld on
# service mysqld start
![](https://static.wixstatic.com/media/cb6190_29fdcf9fb33e4e91a6cce7d2061932ca~mv2.png/v1/fill/w_49,h_8,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_29fdcf9fb33e4e91a6cce7d2061932ca~mv2.png)
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
![](https://static.wixstatic.com/media/cb6190_a9c2ef3040b14e9b8036d7e0c9981036~mv2.png/v1/fill/w_49,h_18,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_a9c2ef3040b14e9b8036d7e0c9981036~mv2.png)
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
![](https://static.wixstatic.com/media/cb6190_153d894c275d4dcd9d5a1c3e1b387052~mv2.png/v1/fill/w_49,h_18,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_153d894c275d4dcd9d5a1c3e1b387052~mv2.png)
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';
![](https://static.wixstatic.com/media/cb6190_9884bbc8151c48139105a53eb74153a1~mv2.png/v1/fill/w_49,h_21,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_9884bbc8151c48139105a53eb74153a1~mv2.png)
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:
![](https://static.wixstatic.com/media/cb6190_367c31af0235431fa4f3b6ae5305746c~mv2.png/v1/fill/w_49,h_25,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/cb6190_367c31af0235431fa4f3b6ae5305746c~mv2.png)
Installation Done!
Related Posts
![](https://static.wixstatic.com/media/baac51_121a663408ad477dacbfbd49d274712e~mv2.jpg/v1/fill/w_147,h_98,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/baac51_121a663408ad477dacbfbd49d274712e~mv2.jpg)
Heading 2
Add paragraph text. Click “Edit Text” to customize this theme across your site. You can update and reuse text themes.