How to Install MySQL 5.5 Server on CentOS 7 with Easy Steps

In this article, we will go through one of the multiple ways to install MySQL 5.5 Server on CentOS 7 through YUM.

MariaDB is a free and open source flavour of well known MySQL database management server software, developed by the brains behind MySQL, it’s envisioned to remain free/open source.

In this tutorial, I will show you how to install MySQL(MariaDB 5.5 stable version) in the most widely used versions of RHEL/CentOS and Fedora distributions. Steps to install mysql 5.5 on CentOS 7 is fairly easy.

But before we go through the steps to install mysql 5.5 I wanted to inform you that Red Hat Enterprise Linux/CentOS 7.0 switched from supporting MySQL to MariaDB as the default database management system.

How to Install MySQL 5.5 Server on CentOS 7 with Easy Steps 1

Steps to Install MySQL 5.5 on CentOS 7

Update all the packages first through yum tool

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.piconets.webwerks.in
* extras: mirrors.piconets.webwerks.in
* updates: mirrors.piconets.webwerks.in
base | 3.6 kB 00:00
extras | 2.9 kB 00:00
updates | 2.9 kB 00:00
updates/7/x86_64/primary_db | 1.9 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-1062.1.2.el7 will be installed
---> Package kernel-tools.x86_64 0:3.10.0-1062.1.1.el7 will be updated
---> Package kernel-tools.x86_64 0:3.10.0-1062.1.2.el7 will be an update
---> Package kernel-tools-libs.x86_64 0:3.10.0-1062.1.1.el7 will be updated
---> Package kernel-tools-libs.x86_64 0:3.10.0-1062.1.2.el7 will be an update
---> Package python-perf.x86_64 0:3.10.0-1062.1.1.el7 will be updated
---> Package python-perf.x86_64 0:3.10.0-1062.1.2.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kernel x86_64 3.10.0-1062.1.2.el7 updates 50 M
Updating:
kernel-tools x86_64 3.10.0-1062.1.2.el7 updates 7.8 M
kernel-tools-libs x86_64 3.10.0-1062.1.2.el7 updates 7.7 M
python-perf x86_64 3.10.0-1062.1.2.el7 updates 7.8 M

Transaction Summary
================================================================================
Install 1 Package
Upgrade 3 Packages

Total download size: 73 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): kernel-tools-3.10.0-1062.1.2.el7.x86_64.rpm | 7.8 MB 00:00:04
(2/4): kernel-tools-libs-3.10.0-1062.1.2.el7.x86_64.rpm | 7.7 MB 00:00:04
(3/4): python-perf-3.10.0-1062.1.2.el7.x86_64.rpm | 7.8 MB 00:00:07
(4/4): kernel-3.10.0-1062.1.2.el7.x86_64.rpm | 50 MB 00:00:12
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 5.8 MB/s | 73 MB 00:00:12
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : kernel-tools-libs-3.10.0-1062.1.2.el7.x86_64 1/7
Updating : kernel-tools-3.10.0-1062.1.2.el7.x86_64 2/7
Updating : python-perf-3.10.0-1062.1.2.el7.x86_64 3/7
Installing : kernel-3.10.0-1062.1.2.el7.x86_64 4/7
Cleanup : kernel-tools-3.10.0-1062.1.1.el7.x86_64 5/7
Cleanup : kernel-tools-libs-3.10.0-1062.1.1.el7.x86_64 6/7
Cleanup : python-perf-3.10.0-1062.1.1.el7.x86_64 7/7
Verifying : kernel-tools-3.10.0-1062.1.2.el7.x86_64 1/7
Verifying : kernel-3.10.0-1062.1.2.el7.x86_64 2/7
Verifying : python-perf-3.10.0-1062.1.2.el7.x86_64 3/7
Verifying : kernel-tools-libs-3.10.0-1062.1.2.el7.x86_64 4/7
Verifying : kernel-tools-libs-3.10.0-1062.1.1.el7.x86_64 5/7
Verifying : kernel-tools-3.10.0-1062.1.1.el7.x86_64 6/7
Verifying : python-perf-3.10.0-1062.1.1.el7.x86_64 7/7

Installed:
kernel.x86_64 0:3.10.0-1062.1.2.el7

Updated:
kernel-tools.x86_64 0:3.10.0-1062.1.2.el7 kernel-tools-libs.x86_64 0:3.10.0-1062.1.2.el7 python-perf.x86_64 0:3.10.0-1062.1.2.el7

Complete!

Install MariaDB Server

[root@localhost ~]# yum install mariadb-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.piconets.webwerks.in
* extras: mirrors.piconets.webwerks.in
* updates: mirrors.piconets.webwerks.in
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.64-1.el7 will be installed
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.64-1.el7.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
mariadb-server x86_64 1:5.5.64-1.el7 base 11 M
Installing for dependencies:
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBD-MySQL x86_64 4.023-6.el7 base 140 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package (+8 Dependent packages)

Total download size: 13 M
Installed size: 62 M
Is this ok [y/d/N]: y
Downloading packages:
(1/9): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00:00
(2/9): perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:00:00
(3/9): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00
(4/9): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00
(5/9): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:00
(6/9): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00:00
(7/9): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00
(8/9): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm | 140 kB 00:00:01
(9/9): mariadb-server-5.5.64-1.el7.x86_64.rpm | 11 MB 00:00:03
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.4 MB/s | 13 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : perl-Data-Dumper-2.145-3.el7.x86_64 1/9
Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 2/9
Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 3/9
Installing : perl-IO-Compress-2.061-2.el7.noarch 4/9
Installing : perl-Net-Daemon-0.48-5.el7.noarch 5/9
Installing : perl-PlRPC-0.2020-14.el7.noarch 6/9
Installing : perl-DBI-1.627-4.el7.x86_64 7/9
Installing : perl-DBD-MySQL-4.023-6.el7.x86_64 8/9
Installing : 1:mariadb-server-5.5.64-1.el7.x86_64 9/9
Verifying : perl-Net-Daemon-0.48-5.el7.noarch 1/9
Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 2/9
Verifying : perl-DBD-MySQL-4.023-6.el7.x86_64 3/9
Verifying : perl-IO-Compress-2.061-2.el7.noarch 4/9
Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 5/9
Verifying : 1:mariadb-server-5.5.64-1.el7.x86_64 6/9
Verifying : perl-DBI-1.627-4.el7.x86_64 7/9
Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 8/9
Verifying : perl-PlRPC-0.2020-14.el7.noarch 9/9

Installed:
mariadb-server.x86_64 1:5.5.64-1.el7

Dependency Installed:
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBD-MySQL.x86_64 0:4.023-6.el7 perl-DBI.x86_64 0:1.627-4.el7
perl-Data-Dumper.x86_64 0:2.145-3.el7 perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7

Complete!

Check if it is installed properly using rpm tool

[root@localhost ~]# rpm -qa | grep -i mariadb-server
mariadb-server-5.5.64-1.el7.x86_64

Start MariaDB Services

[root@localhost ~]# service mariadb start
Redirecting to /bin/systemctl start mariadb.service

[root@localhost ~]# service mariadb status
Redirecting to /bin/systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2019-10-06 13:53:38 EDT; 9s ago
Process: 24918 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 24831 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 24917 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─24917 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─25079 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-fi...

Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: MySQL manual for more instructions.
Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: Please report any problems at http://mariadb.org/jira
Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: The latest information about MariaDB is available at http://mariadb.org/.
Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: You can find additional information about the MySQL part at:
Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: http://dev.mysql.com
Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: Consider joining MariaDB's strong and vibrant community:
Oct 06 13:53:36 localhost.localdomain mariadb-prepare-db-dir[24831]: https://mariadb.org/get-involved/
Oct 06 13:53:36 localhost.localdomain mysqld_safe[24917]: 191006 13:53:36 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Oct 06 13:53:36 localhost.localdomain mysqld_safe[24917]: 191006 13:53:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Oct 06 13:53:38 localhost.localdomain systemd[1]: Started MariaDB database server.

Login to MariaDB

[root@localhost ~]# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

In the next article, i will take you through another way to install mysql on CentOS 7.

Also Read: MySQL Interview Questions

For more info on MySQL, Please go to this link.

Advertisements
Advertisements

Leave a Reply