UPCOMING EVENT

Let's Meet during iFX EXPO International 2024 in Limassol, Cyprus (18-20 June)

Book a Meeting
  • +357 2425 0808
  • Login
  • English

Home

Blog

How To Install MySQL 5.7 on AlmaLinux 8...

How To Install MySQL 5.7 on AlmaLinux 8

How To Install MySQL 5.7 on AlmaLinux 8

NetShop ISP

NetShop ISP · Blog Author

Aug 02, 2023 · Technical Tutorials

In this article we will demonstrate the steps you need to perform on your Almalinux 8 server to install MySQL 5.7.

Although the current stable version of MySQL is 8.0, we decided to publish this article anyway as there is an increased demand for installing MySQL 5.7 on new Linux distributions such as Almalinux 8.

Steps to Install MySQL 5.7 on AlmaLinux 8

Follow the next steps to complete successfully the installation of MySQL 5.7 (community edition) on your Almalinux 8 server.

Step 1. Update your system

root@localhost:~$ dnf update -y

Once the update completes, reboot your server as follows:

root@localhost:~$ shutdown -r now

Step 2 – Add the Enterprise Linux 7 Repository for MySQL 5.7

By default, AlmaLinux 8’s repository contains the MySQL 8.0 packages. Therefore, we need to add the EL7 repository in order to install MySQL 5.7. Copy the following command and paste it on your server’s terminal:

root@localhost:~$ tee /etc/yum.repos.d/mysql-community.repo<<EOF
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/\$basearch/
enabled=1
gpgcheck=0

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

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

Once done, run the following commands to disable the default mysql AppStream modules:

root@localhost:~$ dnf remove @mysql
root@localhost:~$ dnf -y module reset mysql
root@localhost:~$ dnf -y module disable mysql

Step 3 – Install MySQL 5.7 on AlmaLinux 8

As we have completed preparing our environment for MySQL 5.7, we now proceed to the installation part.

Execute the following command to disable the MySQL 8.0 repo:

root@localhost:~$ dnf config-manager --disable mysql80-community

Now, enable the MySQL 5.7 repo:

root@localhost:~$ dnf config-manager --enable mysql57-community

Finally, let’s install MySQL 5.7 using the following command:

root@localhost:~$ dnf install mysql-community-server -y

That should do the job! To verify the success of your MySQL 5.7 installation, check the version by issuing the following command:

root@localhost:~$ rpm -qi mysql-community-server

Sample Output:

MySQL 5.7 verify installed version on AlmaLinux 8

It’s time to proceed with configuring MySQL 5.7 on the server in order to start using it properly.

Step 4 – Configure MySQL 5.7 on AlmaLinux 8 Server

Start the mysql service and enable it to auto-start on boot, using the following commands:

root@localhost:~$ systemctl start mysqld
root@localhost:~$ systemctl enable mysqld

Now, execute the following command to retrieve the temporary password for root, as generated using the installation process:

root@localhost:~$ grep 'A temporary password' /var/log/mysqld.log | tail -1

A sample output will be this:

2022-01-19T23:03:58.688374Z 1 [Note] A temporary password is generated for root@localhost: 4*De@eF^9abG

Now that we have the temporary root password, we proceed to the last configuration steps of MySQL 5.7.

root@localhost:~$ mysql_secure_installation

You will be asked to enter the current password (in our example that is 4*De@eF^9abG) and then you will be asked to set a new mysql root password.

Then, press “Y” when prompted as follows:

Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

Congratulations! Following the above simple steps we have demonstrated how to install MySQL 5.7 on AlmaLinux 8 server!

Press Releases
74

Free VPS Trial

No Credit Card Required.

Recent Posts

MT5 Access Server for Forex Brokers: Virtual vs. Dedicated

MT5 Access Server for Forex Brokers: Virtual vs. Dedicated

14 June, 2024

How To Extend Root Partition using Home Partition space in CentOS

How To Extend Root Partition using Home Partition space in CentOS

30 May, 2024

NetShop ISP to Attend iFX EXPO International 2024 and Announce Global Infrastructure Expansion

NetShop ISP to Attend iFX EXPO International 2024 and Announce Global Infrastructure Expansion

23 May, 2024

TNFX Broker Partners with NetShop ISP to Offer Low-Latency Forex VPS to Traders

TNFX Broker Partners with NetShop ISP to Offer Low-Latency Forex VPS to Traders

14 May, 2024

How to Install Nginx, MySQL, PHP on Ubuntu 22.04 (LEMP)

How to Install Nginx, MySQL, PHP on Ubuntu 22.04 (LEMP)

10 May, 2024

#letushostyou

Award Winning Hosting Provider established in 2004.

120 Faneromenis Avenue, Imperial Tower, 2nd Floor, Larnaca 6031, Cyprus

Products

Bare Metal Servers

Customized Servers

Virtual / Cloud Servers

Forex VPS

Storage VPS

cPanel Web Hosting

Reseller Web Hosting

Colocation

Addons

Premium DNS

Email Hosting

Cloud Backup

DDoS Protection

Licenses

SSL Certificates

Domain Names

Premium SLAs

About Us

Data Center Locations

Looking Glass

Our Company

Contact Us

Careers in Cyprus

Become a Partner

Awards

Certifications

© 2024 S.S. NetShop Internet Services Ltd. All rights reserved.  Terms & Conditions  |  Privacy Policy
CY Reg. Number: HE 217340 | EU VAT Number: CY10217340J

Visa
Mastercard
PayPal
Revolut
Wire Transfer