My first challenge is that I am not (was not?) well versed in software installation management on any Linux platform. I've compiled the instructions below from various sources - most notably the following two:
http://idroot.net/tutorials/completely-removing-mysql-server-centos/
https://stackoverflow.com/questions/33362904/completely-remove-mariadb-or-mysql-from-centos-7-or-rhel-7
Below is what I've been using as a step-by-step to install MariaDB on my RHEL7 servers. Hopefully it can help someone else too.
Note: you'll want to make sure you sudo to root on the server when running the steps below.
1. Confirm that MariaDB is installed (even though it's supposed to ship with RHEL7, I like to check that it hasn't been removed by our server team)
mysql
--version
-- or --
yum
list installed | grep mariadb
2. Uninstall the MariaDB version that comes with RHEL7. This will remove any config files as well.
yum
remove mysql-client mysql-server mysql-common mysql-devel
rm
-rf /etc/my.cnf
rm
-rf /etc/my.cnf.d/
If the above doesn't work (if it's Mariadb and not mysql for example) use the following:
If the above doesn't work (if it's Mariadb and not mysql for example) use the following:
yum
remove mariadb mariadb-server mariadb-libs
rm
-rf /etc/my.cnf
rm
-rf /etc/my.cnf.d/3. Create a MariaDB repo under /etc/yum.repos.d/. MariaDB provides a handy utility that will generate your repo file based on the OS distribution, version, etc. You can find it here: https://downloads.mariadb.org/mariadb/repositories/#mirror=accretive
Because I'm installing on multiple servers of the same version, my repo file looks like this:
vi
/etc/yum.repos.d/mariadb.repo
#
MariaDB 10.2 RedHat repository list - created 2017-12-22 13:28 UTC
[mariadb]
name
= MariaDB
baseurl
= http://yum.mariadb.org/10.2/rhel7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
4. One this file is created - if you have a proxy to get through, you have to add it to your repo or you're not getting anywhere. This step messed me up for awhile as I wasn't sure how/where to add proxy info. You can add your proxy info to the above using the following example:
echo proxy=http://proxy.somecompany.com:80 >> /etc/yum.repos.d/mariadb.repo
5. Now it's time to start the MariaDB installation.
yum install MariaDB-server MariaDB-client
The above will run and install MariaDB's latest version using the repository file created above.
6. Start MariaDB services
systemctl start mariadb
7. It's a good idea at this point to run the server hardening script - you can find information on it here: https://www.certdepot.net/rhel7-install-mariadbmysql/
To run server hardening:
mysql_secure_installation
8. You can check your installation using the following:
mysqladmin -u root -p version
Next steps will be to configure the my.cnf file, figure out monitoring, how to configure a different user to run the MariaDB service, apply security standards, connect using a GUI tool ...... but at least for now, here's a running MariaDB environment to start out.