DEV Community

astromodem
astromodem

Posted on

Headless Raspberry Pi Homelab – Part 3: SSH & MariaDB (MySQL Compatible) Installation

Project Overview

This section will demonstrate how to remotely access a Raspberry Pi using SSH, interact with the Linux operating system, and prepare the system for installing MariaDB (MySQL Compatible). The installation process follows the steps documented in the tutorial linked below:

Setup a Raspberry Pi MYSQL Database

Step 1: SSH into the Raspberry Pi

SSH was used to establish secure remote access to the Raspberry Pi over the local area network. This permitted full command-line control over the Raspberry Pi's Linux operating system.

SSH into the Raspberry Pi

Step 2: Update & Upgrade the packages

The following commands were executed to update the package lists and upgrade installed packages

sudo apt update && sudo apt upgrade

Package upgrade and update

Step 3: Database installation

Execute the following command to begin the installation process of MariaDB

sudo apt install mariadb-server

Package installation

Step 4: Database provisioning process

Execute the following command to start the provisioning process. From there, you can configure the database to your preference.

sudo mariadb-secure-installation

Step 5: Verify database status

Execute the following command to verify that the database service is enabled

systemctl status mysql

MySQL status

Step 6: Access the database as the root user

Execute the following command to verify access to the server

sudo mysql -u root -p

Access to MySQL

Top comments (0)