Installation of MySQL Server in Linux

By DBAStack

Published on:

Installation of MySQL Server in Linux

Introduction

In our earlier blog, we covered the Installation of MySQL server in Linux using the repository method which was the first step towards installation series. if you haven't checked it out yet, we recommend reading that post first.

Installation of MySQL Server in Linux : Method B

This is the RPM-based installation without using the repository method.

Note: – Methods A and B require execution as the root user, while Method C allows installation using the MySQL user or any other non-root user.

Step 1) In this case we can Directly Download MySQL Software onto the server.

Go to MySQL's official Website and check the bundle.tar (mysql-8.0.30-1.el7.x86_64.rpm-bundle.tar) file or any other updated version as per your requirement.

Step 2) Download the bundle.tar directly in your Virtual Machine by using the wget command.

Command: – wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.30-1.el7.x86_64.rpm-bundle.tar

Output

wget command

Step 3) Create the directory where you will untar the bundle file.

Directory Path : /local/bundlemysql-8

Command to untar the bundle file : tar -xvf mysql-8.0.30-1.el7.x86_64.rpm-bundle.tar -C /local/bundlemysql-8

Output

untar the bundle file

Step 4) Now we need to install the dependencies and proceed further with the installation.

yum install openssl-devel -y
yum install perl-JSON -y
yum install perl-devel -y

Step 5) Install the Actual MySQL Software using rpm -ivh or yum command.

Command

yum install -y *.rpm –nodeps
or
rpm -ivh mysql-community-*.rpm –nodeps
or
rpm -ivh *.rpm –nodeps

Starting and Stopping MySQL Server

Status: – systemctl status mysqld

Start: – systemctl start mysqld

Stop: – systemctl stop mysqld

Securing Your MySQL Installation

We need to execute mysql_secure_installation which helps to remove the anonymous users, disable remote root login as well as get the temporary password so that we can log in for the first time and reset the password as per our requirement.

Temporary password location: – grep 'temporary password' /var/log/mysqld.log

Output

mysql_secure_installation for the Installation of MySQL Server in Linux
mysql_secure_installation

Testing Your MySQL Installation

Login Status Output

Login to the database

Connection Status Output

Status of the server.

Conclusion

Finally!! We have done the Installation of MySQL Server in Linux for Method B.
If you enjoyed the article, please leave a comment and share it with your friends. Also, let me know which Oracle and MySQL topics you'd like to see covered in future articles.

In our next article, we will cover the last method which is the binary-based method.

Cheers!!

DBAStack

I have experience in database technology for more than 8 years. I hope with the help of this blog I will share knowledge and real-world experience with you all. You all can join me and together we will explore the world of database technology!

Related Post

Storage Engines in MySQL 8

Example of Storage Engine in MySQL 8

Installation of MySQL Server

Leave a Comment