MariaDB Installation

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Linux

Prerequisites

  • The host name should be resolvable with resolveip.

RHEL 7

yum install -y mariadb-server mariadb

⚠️ After installation, makes sure you go through the post install steps, described below.

Post-Install

MariaDB Configuration - Post Install

Uninstallation

Uninstallation with state removal:

systemctl stop mariadb.service
systemctl disable mariadb.service
yum remove mariadb-server mariadb
# remove data
rm -r /var/lib/mysql
# remove logs
rm -r /var/log/mariadb
rm -r /var/run/mariadb

Mac

brew install mariadb

Post-Install Configuration

Immediately after installation, start the database as described in To Start at Boot and run mysql_secure_installation.

As configured by the initial installation, the script has to be run by root, which authenticates itself using system credential. In consequence, mysql_secure_installation must be used as sudo:

sudo /opt/brew/bin/mysql_secure_installation

[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Switch to unix_socket authentication [Y/n] n
... skipping.
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
[...]
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] Y
[...]
Remove test database and access to it? [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
[...]
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

To Start at Boot

brew services start mariadb

To Start When Needed

To run on demand:

/opt/brew/opt/mariadb/bin/mysqld_safe --datadir\=/opt/brew/var/mysql