Installing mariadb
Capital City Christian Church

The RDBMS the church uses began with MySQL. Then mariadb came along as a fork intended to be more suited for smaller environments. In fact mariadb is so mixed with MySQL that you will find all sorts of MySQL labeled files and the like within mariadb. For the purpose of this documentation they are used interchangeably.


Installing mariadb

These notes apply to installing mariadb version 10 to Kali (2021 4) Linux (5.15)

The steps in this page are taken from; https://computingforgeeks.com/how-to-install-mariadb-on-kali-linux/ That page will provide a more detailed explanation of these steps.

Prep your host;
    $ sudo apt update
    $ sudo apt upgrade
    $ sudo reboot
Setup the proper repository;
    $ sudo apt -y install software-properties-common gnupg2
    $ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
    $ echo "deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.6/debian
    bullseye main" | sudo tee /etc/apt/sources.list.d/mariadb.list
Update your local apt database;
    $ sudo apt update
    $ apt policy mariadb-server
Final prep of your host;
    $ sudo apt update
    $ sudo apt remove mysql-common
    $ sudo apt install mariadb-server
Start mariadb running;
    $ sudo systemctl enable --now mariadb
    $ systemctl status mariadb
Set the basic security for your new installation;
    $ sudo mysql_secure_installation

These are the answers to the questions;

    Enter current password for root (enter for none):
    Switch to unix_socket authentication [Y/n] y
    Change the root password? [Y/n] y
    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

Now you can log into your database and begin work.

    $ mysql -u root -p

I am using Linux Mint's graphic application manager.

Search for and install. These do take some time to download and install.
    Mysql server
    Mysql workbench

Verify the install:
ben@ben-b:~$ mysql -V
mysql  Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using  EditLine wrapper


ben@ben-b:~$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-05-12 14:36:03 EDT; 6min ago
 Main PID: 21808 (mysqld)
    Tasks: 27 (limit: 4915)
   CGroup: /system.slice/mysql.service
           └─21808 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid

May 12 14:36:03 ben-b systemd[1]: Starting MySQL Community Server...
May 12 14:36:03 ben-b systemd[1]: Started MySQL Community Server.

Login as root

ben@ben-b:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.30-0ubuntu0.18.04.1 (Ubuntu)

mysql> status
--------------
mysql  Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using  EditLine wrapper

Connection id:      5
Current database:
Current user:       root@localhost
SSL:            Not in use
Current pager:      stdout
Using outfile:      ''
Using delimiter:    ;
Server version:     5.7.30-0ubuntu0.18.04.1 (Ubuntu)
Protocol version:   10
Connection:     Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:        /var/run/mysqld/mysqld.sock
Uptime:         8 min 32 sec

Threads: 1  Questions: 9  Slow queries: 0  Opens: 105  Flush tables: 1  Open tables: 98  Queries per second avg: 0.017
--------------
mysql> exit
Bye

ben@ben-b:~$ sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: Y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Please set the password for root here.

Provided password: (provide a password here)

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : n

 ... skipping.
By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y
Success.

All done!
ben@ben-b:~$



The following are some previous notes I want to keep...

Installing mariadb
Capital City Christian Church

Installing mariadb

These notes apply to installing mariadb version 10 to Kali (2021 4) Linux (5.15)

The steps in this page are taken from; https://computingforgeeks.com/
how-to-install-mariadb-on-kali-linux/ That page will provide a more
detailed explanation of these steps.

Prep your host;

    $ sudo apt update
    $ sudo apt upgrade
    $ sudo reboot

Setup the proper repository;

    $ sudo apt -y install software-properties-common gnupg2
    $ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
    $ echo "deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.6/debian
    bullseye main" | sudo tee /etc/apt/sources.list.d/mariadb.list

Update your local apt database;

    $ sudo apt update
    $ apt policy mariadb-server

Final prep of your host;

    $ sudo apt update
    $ sudo apt remove mysql-common
    $ sudo apt install mariadb-server

Start mariadb running;

    $ sudo systemctl enable --now mariadb
    $ systemctl status mariadb

Set the basic security for your new installation;

    $ sudo mysql_secure_installation

These are the answers to the questions;

    Enter current password for root (enter for none):
    Switch to unix_socket authentication [Y/n] y
    Change the root password? [Y/n] y
    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

Now you can log into your database and begin work.

    $ mysql -u root -p