MariaDB RHSC installation

To stick with current version of MariaDB to ensure receiving the latest features and security patches.

Use the following steps to install MariaDB re-distributed by Redhead Software Collection (RHSC) on RHEL 6.x:

[root@dbverstyhost ~]# cd /net/e12-dma-04/nas/mariadb/support_files
[root@dbverstyhost support_files]# ls -l
total 12
-rwxr-xr-x 1 59738 59738 171 Feb 7 20:28 yum_chk_mdb_ver
-rwxr-xr-x 1 59738 59738 2383 Feb 7 21:17 yum_li_mariadb_server
-rwxr-xr-x 1 59738 59738 767 Feb 1 22:27 yum_rm_mariadb_server

[root@dbverstyhost support_files]#

Use yum_li_mariadb_server to perform the installation of the latest version available from RHSC. Please note, there may be a time lag between the latest available version from RHSC and the most recent release from MariaDB (https://downloads.mariadb.org/mariadb/+releases/ ).

[root@dbverstyhost support_files]# ./yum_li_mariadb_server
Usage: ./yum_li_mariadb_server [s|g]
s: standalone
g: galera
[root@dbverstyhost support_files]#

Note that the option “s” installs the MariaDB enterprise edition ONLY where option “g” installs MariaDB Galera Cluster add-on packages ONLY. If Galera Cluster installation is intended, please run with option “s” first followed by option “g”:

[root@dbverstyhost support_files]# ./yum_li_mariadb_server s
/net dir exists
Host is RHEL6
Changing dir to local repo…
Back up exiting repo
create repo
Installing on RHEL6
Setting up Local Package Process
Examining rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64.rpm: 1:rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64
Marking rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64.rpm to be installed
2016Q3 | 1.2 kB 00:00
NOT-CERTIFIED | 2.9 kB 00:00
NOT-CERTIFIED/primary_db | 42 MB 00:00
Examining rh-mariadb101-mariadb-10.1.19-6.el6.x86_64.rpm: 1:rh-mariadb101-mariadb-10.1.19-6.el6.x86_64
Marking rh-mariadb101-mariadb-10.1.19-6.el6.x86_64.rpm to be installed
Examining rh-mariadb101-runtime-2.2-3.el6.x86_64.rpm: rh-mariadb101-runtime-2.2-3.el6.x86_64
Marking rh-mariadb101-runtime-2.2-3.el6.x86_64.rpm to be installed
Examining rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64.rpm: 1:rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64
Marking rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64.rpm to be installed
Examining rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64.rpm: 1:rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64
Marking rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64.rpm to be installed
Examining rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64.rpm: 1:rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64
Marking rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package rh-mariadb101-mariadb.x86_64 1:10.1.19-6.el6 will be installed
—> Package rh-mariadb101-mariadb-common.x86_64 1:10.1.19-6.el6 will be installed
—> Package rh-mariadb101-mariadb-config.x86_64 1:10.1.19-6.el6 will be installed
—> Package rh-mariadb101-mariadb-errmsg.x86_64 1:10.1.19-6.el6 will be installed
—> Package rh-mariadb101-mariadb-server.x86_64 1:10.1.19-6.el6 will be installed
—> Package rh-mariadb101-runtime.x86_64 0:2.2-3.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Installing:
rh-mariadb101-mariadb x86_64 1:10.1.19-6.el6 /rh-mariadb101-mariadb-10.1.19-6.el6.x86_64 39 M
rh-mariadb101-mariadb-common x86_64 1:10.1.19-6.el6 /rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64 239 k
rh-mariadb101-mariadb-config x86_64 1:10.1.19-6.el6 /rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64 1.3 k
rh-mariadb101-mariadb-errmsg x86_64 1:10.1.19-6.el6 /rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64 1.9 M
rh-mariadb101-mariadb-server x86_64 1:10.1.19-6.el6 /rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64 87 M
rh-mariadb101-runtime x86_64 2.2-3.el6 /rh-mariadb101-runtime-2.2-3.el6.x86_64 23 k
Transaction Summary
================================================================================================================================
Install 6 Package(s)
Total size: 129 M
Installed size: 129 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : rh-mariadb101-runtime-2.2-3.el6.x86_64 1/6
Installing : 1:rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64 2/6
Installing : 1:rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64 3/6
Installing : 1:rh-mariadb101-mariadb-10.1.19-6.el6.x86_64 4/6
Installing : 1:rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64 5/6
Installing : 1:rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64 6/6
Verifying : 1:rh-mariadb101-mariadb-10.1.19-6.el6.x86_64 1/6
Verifying : 1:rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64 2/6
Verifying : 1:rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64 3/6
Verifying : 1:rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64 4/6
Verifying : 1:rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64 5/6
Verifying : rh-mariadb101-runtime-2.2-3.el6.x86_64 6/6
Installed:
rh-mariadb101-mariadb.x86_64 1:10.1.19-6.el6 rh-mariadb101-mariadb-common.x86_64 1:10.1.19-6.el6
rh-mariadb101-mariadb-config.x86_64 1:10.1.19-6.el6 rh-mariadb101-mariadb-errmsg.x86_64 1:10.1.19-6.el6
rh-mariadb101-mariadb-server.x86_64 1:10.1.19-6.el6 rh-mariadb101-runtime.x86_64 0:2.2-3.el6
Complete!
[root@dbverstyhost support_files]#

Now install the Galera Cluster package:

[root@dbverstyhost support_files]# ./yum_li_mariadb_server g
/net dir exists
Host is RHEL6
Changing dir to local repo…
Back up exiting repo
create repo
Installing Galera on RHEL6
Setting up Local Package Process
Examining rh-mariadb101-galera-25.3.12-9.el6.x86_64.rpm: rh-mariadb101-galera-25.3.12-9.el6.x86_64
Marking rh-mariadb101-galera-25.3.12-9.el6.x86_64.rpm to be installed
NOT-CERTIFIED | 2.9 kB 00:00
Examining rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64.rpm: 1:rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64
Marking rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64.rpm to be installed
Examining rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64.rpm: rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64
Marking rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package rh-mariadb101-boost-program-options.x86_64 0:1.58.0-16.el6 will be installed
—> Package rh-mariadb101-galera.x86_64 0:25.3.12-9.el6 will be installed
—> Package rh-mariadb101-mariadb-server-galera.x86_64 1:10.1.19-6.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Installing:
rh-mariadb101-boost-program-options x86_64 1.58.0-16.el6 /rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64 417 k
rh-mariadb101-galera x86_64 25.3.12-9.el6 /rh-mariadb101-galera-25.3.12-9.el6.x86_64 3.5 M
rh-mariadb101-mariadb-server-galera x86_64 1:10.1.19-6.el6 /rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64 36 k
Transaction Summary
================================================================================================================================
Install 3 Package(s)
Total size: 4.0 M
Installed size: 4.0 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64 1/3
Installing : rh-mariadb101-galera-25.3.12-9.el6.x86_64 2/3
Installing : 1:rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64 3/3
Verifying : rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64 1/3
Verifying : rh-mariadb101-galera-25.3.12-9.el6.x86_64 2/3
Verifying : 1:rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64 3/3
Installed:
rh-mariadb101-boost-program-options.x86_64 0:1.58.0-16.el6 rh-mariadb101-galera.x86_64 0:25.3.12-9.el6
rh-mariadb101-mariadb-server-galera.x86_64 1:10.1.19-6.el6
Complete!
[root@dbverstyhost support_files]#

To verify the packages that were installed:

[root@dbverstyhost support_files]# rpm -qa | grep -i mariadb
rh-mariadb101-runtime-2.2-3.el6.x86_64
rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64
rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64
rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64
rh-mariadb101-mariadb-10.1.19-6.el6.x86_64
rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64
rh-mariadb101-galera-25.3.12-9.el6.x86_64
rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64
rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64
[root@dbverstyhost support_files]#

To uninstall the packages:

[root@dbverstyhost support_files]# ./yum_rm_mariadb_server
Setting up Remove Process
Resolving Dependencies
–> Running transaction check
—> Package rh-mariadb101-mariadb.x86_64 1:10.1.19-6.el6 will be erased
—> Package rh-mariadb101-mariadb-common.x86_64 1:10.1.19-6.el6 will be erased
–> Processing Dependency: rh-mariadb101-mariadb-common(x86-64) = 1:10.1.19-6.el6 for package: 1:rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64
—> Package rh-mariadb101-mariadb-config.x86_64 1:10.1.19-6.el6 will be erased
—> Package rh-mariadb101-mariadb-errmsg.x86_64 1:10.1.19-6.el6 will be erased
—> Package rh-mariadb101-mariadb-server.x86_64 1:10.1.19-6.el6 will be erased
—> Package rh-mariadb101-runtime.x86_64 0:2.2-3.el6 will be erased
–> Processing Dependency: rh-mariadb101-runtime for package: rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64
–> Running transaction check
—> Package rh-mariadb101-boost-program-options.x86_64 0:1.58.0-16.el6 will be erased
–> Processing Dependency: libboost_program_options.so.rh-mariadb101-1.58.0()(64bit) for package: rh-mariadb101-galera-25.3.12-9.el6.x86_64
—> Package rh-mariadb101-mariadb-server-galera.x86_64 1:10.1.19-6.el6 will be erased
–> Running transaction check
—> Package rh-mariadb101-galera.x86_64 0:25.3.12-9.el6 will be erased
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Removing:
rh-mariadb101-mariadb x86_64 1:10.1.19-6.el6 @/rh-mariadb101-mariadb-10.1.19-6.el6.x86_64 39 M
rh-mariadb101-mariadb-common x86_64 1:10.1.19-6.el6 @/rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64 239 k
rh-mariadb101-mariadb-config x86_64 1:10.1.19-6.el6 @/rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64 1.3 k
rh-mariadb101-mariadb-errmsg x86_64 1:10.1.19-6.el6 @/rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64 1.9 M
rh-mariadb101-mariadb-server x86_64 1:10.1.19-6.el6 @/rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64 87 M
rh-mariadb101-runtime x86_64 2.2-3.el6 @/rh-mariadb101-runtime-2.2-3.el6.x86_64 23 k
Removing for dependencies:
rh-mariadb101-boost-program-options x86_64 1.58.0-16.el6 @/rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64 417 k
rh-mariadb101-galera x86_64 25.3.12-9.el6 @/rh-mariadb101-galera-25.3.12-9.el6.x86_64 3.5 M
rh-mariadb101-mariadb-server-galera x86_64 1:10.1.19-6.el6 @/rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64 36 k
Transaction Summary
================================================================================================================================
Remove 9 Package(s)
Installed size: 133 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : 1:rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64 1/9
Erasing : 1:rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64 2/9
Erasing : 1:rh-mariadb101-mariadb-10.1.19-6.el6.x86_64 3/9
Erasing : 1:rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64 4/9
Erasing : 1:rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64 5/9
Erasing : 1:rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64 6/9
Erasing : rh-mariadb101-galera-25.3.12-9.el6.x86_64 7/9
Erasing : rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64 8/9
Erasing : rh-mariadb101-runtime-2.2-3.el6.x86_64 9/9
Verifying : 1:rh-mariadb101-mariadb-10.1.19-6.el6.x86_64 1/9
Verifying : 1:rh-mariadb101-mariadb-common-10.1.19-6.el6.x86_64 2/9
Verifying : 1:rh-mariadb101-mariadb-server-10.1.19-6.el6.x86_64 3/9
Verifying : 1:rh-mariadb101-mariadb-server-galera-10.1.19-6.el6.x86_64 4/9
Verifying : 1:rh-mariadb101-mariadb-config-10.1.19-6.el6.x86_64 5/9
Verifying : 1:rh-mariadb101-mariadb-errmsg-10.1.19-6.el6.x86_64 6/9
Verifying : rh-mariadb101-boost-program-options-1.58.0-16.el6.x86_64 7/9
Verifying : rh-mariadb101-galera-25.3.12-9.el6.x86_64 8/9
Verifying : rh-mariadb101-runtime-2.2-3.el6.x86_64 9/9
Removed:
rh-mariadb101-mariadb.x86_64 1:10.1.19-6.el6 rh-mariadb101-mariadb-common.x86_64 1:10.1.19-6.el6
rh-mariadb101-mariadb-config.x86_64 1:10.1.19-6.el6 rh-mariadb101-mariadb-errmsg.x86_64 1:10.1.19-6.el6
rh-mariadb101-mariadb-server.x86_64 1:10.1.19-6.el6 rh-mariadb101-runtime.x86_64 0:2.2-3.el6
Dependency Removed:
rh-mariadb101-boost-program-options.x86_64 0:1.58.0-16.el6 rh-mariadb101-galera.x86_64 0:25.3.12-9.el6
rh-mariadb101-mariadb-server-galera.x86_64 1:10.1.19-6.el6
Complete!
[root@dbverstyhost support_files]#

Verify to ensure the packages were removed:

[root@dbverstyhost support_files]# rpm -qa | grep -i mariadb
[root@dbverstyhost support_files]#

After the installation is complete, unlike the standard MariaDB distribution the database server will not start automatically. Start the database server for the first time:

[root@dbverstyhost ~]# service rh-mariadb101-mariadb start
Initializing MariaDB database
2017-02-15 18:21:27 139937530148832 [Note] /opt/rh/rh-mariadb101/root/usr/libexec/mysqld (mysqld 10.1.19-MariaDB) starting as process 13812 …
2017-02-15 18:21:31 139903293364192 [Note] /opt/rh/rh-mariadb101/root/usr/libexec/mysqld (mysqld 10.1.19-MariaDB) starting as process 13841 …
2017-02-15 18:21:34 140442181044192 [Note] /opt/rh/rh-mariadb101/root/usr/libexec/mysqld (mysqld 10.1.19-MariaDB) starting as process 13874 …

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

scl enable rh-mariadb101 — ‘/opt/rh/rh-mariadb101/root/usr/bin/mysqladmin’ -u root password ‘new-password’
scl enable rh-mariadb101 — ‘/opt/rh/rh-mariadb101/root/usr/bin/mysqladmin’ -u root -h dbverstyhost password ‘new-password’

Alternatively you can run:
scl enable rh-mariadb101 — ‘/opt/rh/rh-mariadb101/root/usr/bin/mysql_secure_installation’

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/

Starting rh-mariadb101-mariadb: [ OK ]
[root@dbverstyhost ~]#

Run the mysql_secure_installation to harden the MariaDB Database:

[root@dbverstyhost my.cnf.d]# scl enable rh-mariadb101 — ‘/opt/rh/rh-mariadb101/root/usr/bin/mysql_secure_installation’
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@dbverstyhost my.cnf.d]#

And the database is ready to go!

  • Ask Question