MariaDB Installation with Yum Command on CentOS 7

Yum Command is an interactive way to install/update/upgrade Linux packages. To Install MariaDB with its all dependencies use the bellow command.

[root@localhost ~]# yum install mariadb*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.iitm.ac.in
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
Package 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 already installed and latest version
Resolving Dependencies
–> Running transaction check
—> Package mariadb.x86_64 1:5.5.44-2.el7.centos will be installed
—> Package mariadb-bench.x86_64 1:5.5.44-2.el7.centos will be installed
–> Processing Dependency: perl(GD) for package: 1:mariadb-bench-5.5.44-2.el7.centos.x86_64
–> Processing Dependency: perl(Data::Dumper) for package: 1:mariadb-bench-5.5.44-2.el7.centos.x86_64
–> Processing Dependency: perl(DBI) for package: 1:mariadb-bench-5.5.44-2.el7.centos.x86_64
—> Package mariadb-devel.x86_64 1:5.5.44-2.el7.centos will be installed
–> Processing Dependency: openssl-devel(x86-64) for package: 1:mariadb-devel-5.5.44-2.el7.centos.x86_64
—> Package mariadb-embedded.x86_64 1:5.5.44-2.el7.centos will be installed
—> Package mariadb-embedded-devel.x86_64 1:5.5.44-2.el7.centos will be installed
—> Package mariadb-server.x86_64 1:5.5.44-2.el7.centos will be installed
–> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.44-2.el7.centos.x86_64
—> Package mariadb-test.x86_64 1:5.5.44-2.el7.centos will be installed
–> Processing Dependency: perl(Test::More) for package: 1:mariadb-test-5.5.44-2.el7.centos.x86_64
–> Processing Dependency: perl(Env) for package: 1:mariadb-test-5.5.44-2.el7.centos.x86_64
–> Running transaction check
—> Package openssl-devel.x86_64 1:1.0.1e-51.el7_2.2 will be installed
–> Processing Dependency: zlib-devel(x86-64) for package: 1:openssl-devel-1.0.1e-51.el7_2.2.x86_64
–> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.1e-51.el7_2.2.x86_64
—> Package perl-DBD-MySQL.x86_64 0:4.023-5.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
—> Package perl-Env.noarch 0:1.04-2.el7 will be installed
—> Package perl-GD.x86_64 0:2.49-3.el7 will be installed
—> Package perl-Test-Simple.noarch 0:0.98-243.el7 will be installed
–> Processing Dependency: perl(Test::Harness) >= 2.03 for package: perl-Test-Simple-0.98-243.el7.noarch
–> Running transaction check
—> Package krb5-devel.x86_64 0:1.13.2-10.el7 will be installed
–> Processing Dependency: libverto-devel for package: krb5-devel-1.13.2-10.el7.x86_64
–> Processing Dependency: libselinux-devel for package: krb5-devel-1.13.2-10.el7.x86_64
–> Processing Dependency: libcom_err-devel for package: krb5-devel-1.13.2-10.el7.x86_64
–> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.13.2-10.el7.x86_64
—> 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
—> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
—> Package zlib-devel.x86_64 0:1.2.7-15.el7 will be installed
–> Running transaction check
—> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
—> Package libcom_err-devel.x86_64 0:1.42.9-7.el7 will be installed
—> Package libselinux-devel.x86_64 0:2.2.2-6.el7 will be installed
–> Processing Dependency: libsepol-devel >= 2.1.9-1 for package: libselinux-devel-2.2.2-6.el7.x86_64
–> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.2.2-6.el7.x86_64
–> Processing Dependency: pkgconfig(libpcre) for package: libselinux-devel-2.2.2-6.el7.x86_64
—> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
—> 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 libsepol-devel.x86_64 0:2.1.9-3.el7 will be installed
—> Package pcre-devel.x86_64 0:8.32-15.el7 will be installed
—> 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                    x86_64    1:5.5.44-2.el7.centos    base       8.9 M
mariadb-bench              x86_64    1:5.5.44-2.el7.centos    base       385 k
mariadb-devel              x86_64    1:5.5.44-2.el7.centos    base       748 k
mariadb-embedded           x86_64    1:5.5.44-2.el7.centos    base       3.6 M
mariadb-embedded-devel     x86_64    1:5.5.44-2.el7.centos    base       7.4 M
mariadb-server             x86_64    1:5.5.44-2.el7.centos    base        11 M
mariadb-test               x86_64    1:5.5.44-2.el7.centos    base       8.0 M
Installing for dependencies:
keyutils-libs-devel        x86_64    1.5.8-3.el7              base        37 k
krb5-devel                 x86_64    1.13.2-10.el7            base       649 k
libcom_err-devel           x86_64    1.42.9-7.el7             base        30 k
libselinux-devel           x86_64    2.2.2-6.el7              base       174 k
libsepol-devel             x86_64    2.1.9-3.el7              base        71 k
libverto-devel             x86_64    0.2.5-4.el7              base        12 k
openssl-devel              x86_64    1:1.0.1e-51.el7_2.2      updates    1.2 M
pcre-devel                 x86_64    8.32-15.el7              base       478 k
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-5.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-Env                   noarch    1.04-2.el7               base        16 k
perl-GD                    x86_64    2.49-3.el7               base       173 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
perl-Test-Harness          noarch    3.28-3.el7               base       302 k
perl-Test-Simple           noarch    0.98-243.el7             base       170 k
zlib-devel                 x86_64    1.2.7-15.el7             base        50 k

Transaction Summary
================================================================================
Install  7 Packages (+21 Dependent packages)

Total download size: 44 M
Installed size: 285 M
Is this ok [y/d/N]: y
Downloading packages:
(1/28): libcom_err-devel-1.42.9-7.el7.x86_64.rpm           |  30 kB   00:13
(2/28): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm         |  37 kB   00:14
(3/28): libsepol-devel-2.1.9-3.el7.x86_64.rpm              |  71 kB   00:13
(4/28): libverto-devel-0.2.5-4.el7.x86_64.rpm              |  12 kB   00:04
(5/28): libselinux-devel-2.2.2-6.el7.x86_64.rpm            | 174 kB   00:20
(6/28): mariadb-bench-5.5.44-2.el7.centos.x86_64.rpm       | 385 kB   00:21
(7/28): krb5-devel-1.13.2-10.el7.x86_64.rpm                | 649 kB   00:45
(8/28): mariadb-devel-5.5.44-2.el7.centos.x86_64.rpm       | 748 kB   00:39
(9/28): mariadb-embedded-5.5.44-2.el7.centos.x86_64.rpm    | 3.6 MB   02:30
(10/28): openssl-devel-1.0.1e-51.el7_2.2.x86_64.rpm        | 1.2 MB   00:49
(11/28): pcre-devel-8.32-15.el7.x86_64.rpm                 | 478 kB   00:18
(12/28): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm    |  32 kB   00:01
(13/28): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm     |  57 kB   00:02
(14/28): perl-DBD-MySQL-4.023-5.el7.x86_64.rpm             | 140 kB   00:05
(15/28): perl-DBI-1.627-4.el7.x86_64.rpm                   | 802 kB   00:29
(16/28): perl-Data-Dumper-2.145-3.el7.x86_64.rpm           |  47 kB   00:02
(17/28): perl-Env-1.04-2.el7.noarch.rpm                    |  16 kB   00:01
(18/28): perl-GD-2.49-3.el7.x86_64.rpm                     | 173 kB   00:08
(19/28): perl-IO-Compress-2.061-2.el7.noarch.rpm           | 260 kB   00:10
(20/28): perl-Net-Daemon-0.48-5.el7.noarch.rpm             |  51 kB   00:02
(21/28): perl-PlRPC-0.2020-14.el7.noarch.rpm               |  36 kB   00:01
(22/28): mariadb-embedded-devel-5.5.44-2.el7.centos.x86_64 | 7.4 MB   04:38
(23/28): perl-Test-Harness-3.28-3.el7.noarch.rpm           | 302 kB   00:09
(24/28): zlib-devel-1.2.7-15.el7.x86_64.rpm                |  50 kB   00:02
(25/28): perl-Test-Simple-0.98-243.el7.noarch.rpm          | 170 kB   00:10
(26/28): mariadb-test-5.5.44-2.el7.centos.x86_64.rpm       | 8.0 MB   04:40
(27/28): mariadb-5.5.44-2.el7.centos.x86_64.rpm            | 8.9 MB   05:31
(28/28): mariadb-server-5.5.44-2.el7.centos.x86_64.rpm     |  11 MB   05:10
——————————————————————————–
Total                                              127 kB/s |  44 MB  05:57
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : perl-Data-Dumper-2.145-3.el7.x86_64                         1/28
Installing : 1:mariadb-5.5.44-2.el7.centos.x86_64                        2/28
Installing : libcom_err-devel-1.42.9-7.el7.x86_64                        3/28
Installing : 1:mariadb-embedded-5.5.44-2.el7.centos.x86_64               4/28
Installing : libverto-devel-0.2.5-4.el7.x86_64                           5/28
Installing : perl-Net-Daemon-0.48-5.el7.noarch                           6/28
Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                 7/28
Installing : zlib-devel-1.2.7-15.el7.x86_64                              8/28
Installing : libsepol-devel-2.1.9-3.el7.x86_64                           9/28
Installing : perl-Test-Harness-3.28-3.el7.noarch                        10/28
Installing : perl-Test-Simple-0.98-243.el7.noarch                       11/28
Installing : perl-GD-2.49-3.el7.x86_64                                  12/28
Installing : perl-Env-1.04-2.el7.noarch                                 13/28
Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                 14/28
Installing : perl-IO-Compress-2.061-2.el7.noarch                        15/28
Installing : perl-PlRPC-0.2020-14.el7.noarch                            16/28
Installing : perl-DBI-1.627-4.el7.x86_64                                17/28
Installing : perl-DBD-MySQL-4.023-5.el7.x86_64                          18/28
Installing : 1:mariadb-server-5.5.44-2.el7.centos.x86_64                19/28
Installing : pcre-devel-8.32-15.el7.x86_64                              20/28
Installing : libselinux-devel-2.2.2-6.el7.x86_64                        21/28
Installing : keyutils-libs-devel-1.5.8-3.el7.x86_64                     22/28
Installing : krb5-devel-1.13.2-10.el7.x86_64                            23/28
Installing : 1:openssl-devel-1.0.1e-51.el7_2.2.x86_64                   24/28
Installing : 1:mariadb-devel-5.5.44-2.el7.centos.x86_64                 25/28
Installing : 1:mariadb-embedded-devel-5.5.44-2.el7.centos.x86_64        26/28
Installing : 1:mariadb-test-5.5.44-2.el7.centos.x86_64                  27/28
Installing : 1:mariadb-bench-5.5.44-2.el7.centos.x86_64                 28/28
Verifying  : keyutils-libs-devel-1.5.8-3.el7.x86_64                      1/28
Verifying  : 1:mariadb-5.5.44-2.el7.centos.x86_64                        2/28
Verifying  : 1:mariadb-server-5.5.44-2.el7.centos.x86_64                 3/28
Verifying  : perl-IO-Compress-2.061-2.el7.noarch                         4/28
Verifying  : pcre-devel-8.32-15.el7.x86_64                               5/28
Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                  6/28
Verifying  : 1:openssl-devel-1.0.1e-51.el7_2.2.x86_64                    7/28
Verifying  : perl-Env-1.04-2.el7.noarch                                  8/28
Verifying  : 1:mariadb-devel-5.5.44-2.el7.centos.x86_64                  9/28
Verifying  : perl-Test-Simple-0.98-243.el7.noarch                       10/28
Verifying  : perl-GD-2.49-3.el7.x86_64                                  11/28
Verifying  : 1:mariadb-embedded-devel-5.5.44-2.el7.centos.x86_64        12/28
Verifying  : 1:mariadb-test-5.5.44-2.el7.centos.x86_64                  13/28
Verifying  : perl-Test-Harness-3.28-3.el7.noarch                        14/28
Verifying  : libsepol-devel-2.1.9-3.el7.x86_64                          15/28
Verifying  : perl-DBI-1.627-4.el7.x86_64                                16/28
Verifying  : zlib-devel-1.2.7-15.el7.x86_64                             17/28
Verifying  : perl-DBD-MySQL-4.023-5.el7.x86_64                          18/28
Verifying  : libselinux-devel-2.2.2-6.el7.x86_64                        19/28
Verifying  : 1:mariadb-bench-5.5.44-2.el7.centos.x86_64                 20/28
Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                        21/28
Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                22/28
Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                          23/28
Verifying  : perl-PlRPC-0.2020-14.el7.noarch                            24/28
Verifying  : libverto-devel-0.2.5-4.el7.x86_64                          25/28
Verifying  : 1:mariadb-embedded-5.5.44-2.el7.centos.x86_64              26/28
Verifying  : krb5-devel-1.13.2-10.el7.x86_64                            27/28
Verifying  : libcom_err-devel-1.42.9-7.el7.x86_64                       28/28

Installed:
mariadb.x86_64 1:5.5.44-2.el7.centos
mariadb-bench.x86_64 1:5.5.44-2.el7.centos
mariadb-devel.x86_64 1:5.5.44-2.el7.centos
mariadb-embedded.x86_64 1:5.5.44-2.el7.centos
mariadb-embedded-devel.x86_64 1:5.5.44-2.el7.centos
mariadb-server.x86_64 1:5.5.44-2.el7.centos
mariadb-test.x86_64 1:5.5.44-2.el7.centos

Dependency Installed:
keyutils-libs-devel.x86_64 0:1.5.8-3.el7
krb5-devel.x86_64 0:1.13.2-10.el7
libcom_err-devel.x86_64 0:1.42.9-7.el7
libselinux-devel.x86_64 0:2.2.2-6.el7
libsepol-devel.x86_64 0:2.1.9-3.el7
libverto-devel.x86_64 0:0.2.5-4.el7
openssl-devel.x86_64 1:1.0.1e-51.el7_2.2
pcre-devel.x86_64 0:8.32-15.el7
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-5.el7
perl-DBI.x86_64 0:1.627-4.el7
perl-Data-Dumper.x86_64 0:2.145-3.el7
perl-Env.noarch 0:1.04-2.el7
perl-GD.x86_64 0:2.49-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
perl-Test-Harness.noarch 0:3.28-3.el7
perl-Test-Simple.noarch 0:0.98-243.el7
zlib-devel.x86_64 0:1.2.7-15.el7

Complete!
[root@localhost ~]#


After The completion of the Installation process you verify the installed packages with below command.


[root@localhost ~]# rpm -qa | grep -i mariadb
mariadb-embedded-5.5.44-2.el7.centos.x86_64
mariadb-embedded-devel-5.5.44-2.el7.centos.x86_64
mariadb-server-5.5.44-2.el7.centos.x86_64
mariadb-test-5.5.44-2.el7.centos.x86_64
mariadb-libs-5.5.44-2.el7.centos.x86_64
mariadb-devel-5.5.44-2.el7.centos.x86_64
mariadb-bench-5.5.44-2.el7.centos.x86_64
mariadb-5.5.44-2.el7.centos.x86_64
[root@localhost ~]#

Now Start MariaDB Service (Generally not started by-default).

[root@localhost ~]# systemctl start mariadb.service 

Start MariaDB without password


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

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

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

MariaDB [(none)]>

You should perform post installation activity such as  set password for root user.The best option for this purpose you use </usr/bin/mysql_secure_installation> Script.

[root@localhost ~]# /usr/bin/mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user.  If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

Normally, root should only be allowed to connect from ‘localhost’.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
… Success!

By default, MariaDB comes with a database named ‘test’ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done!  If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]#


Now you use  MariaDB with root user and  password

[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 5.5.44-MariaDB MariaDB Server

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

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

MariaDB [(none)]>

Start/Restart/Stop/Status of  MariaDB Server

[root@localhost ~]# systemctl start mariadb.service 

[root@localhost ~]# systemctl restart mariadb.service 

[root@localhost ~]# systemctl stop mariadb.service  

[root@localhost ~]# systemctl status mariadb.service  

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s