0% found this document useful (0 votes)
58 views

03 MariaDB

The document describes an experiment to install and configure MariaDB database on a Raspberry Pi 3. It discusses MariaDB and how it is used to store database files. It then provides instructions on installing MariaDB via the apt package manager, securing it by setting a root password, and connecting to the database as the root user. It also recommends creating a new user for application access rather than using the root account directly.

Uploaded by

Shivani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

03 MariaDB

The document describes an experiment to install and configure MariaDB database on a Raspberry Pi 3. It discusses MariaDB and how it is used to store database files. It then provides instructions on installing MariaDB via the apt package manager, securing it by setting a root password, and connecting to the database as the root user. It also recommends creating a new user for application access rather than using the root account directly.

Uploaded by

Shivani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EXPERIMENT NO 04

TITLE : To install and configure Maria DB database on Rasberry Pi 3.

AIM: To configure the hardware setup and installation of mariaDB database on Raspberry Pi 3.

SCOPE: Understanding to configure the hardware setup and installation of mariaDB database
on Raspberry Pi 3.

FACILITIES/ APPARATUS:

i) Hardware:

Raspberry Pi 3 (B+), Monitor, USB Keyboard, USB Mouse, HDMI-VGA Convertor, A high-
quality 2.5A micro USB power supply, Micro SD card with NOOBS.

ii) Software:

Raspbian Operating System, Python 3.0

THEORY:

MARIADB DATABASE

A database as file where we can store any data you need to keep. a database as a folder on
computer, with many excel files in it.The folder is the database, each Excel file is a table, and
they contain one column for each data to store.

MariaDB is the service that will host the database. Similar to how Apache is used to host
a web server, MariaDB is used to store data in databases.Bottom of Form

DIFFERENCE BETWEEN MARIADB AND MYSQL?

MariaDB is a fork of MySQL (= they created it from a copy of the MySQL source code). there’s
barely any difference. MariaDB has been created following the MySQL acquisition by Oracle in
2009.So, it’s highly compatible with MySQL. Most of the projects will work on MariaDB without
requiring any changes.

INSTALLATION OF MARIADB ON RASPBERRY PI OS

Now that you have more information about what MariaDB is, you can try installing it by reading
the following instructions. Here are the required steps to install MariaDB on your Raspberry Pi

Step 1: Install the mariadb-server package.


MariaDB is available in the Raspberry Pi OS repository, so the installation is straightforward.
Open a terminal and always, start by updating your system:

sudo apt update

sudo apt upgrade

Use root to access MariaDB for the first time.Complete the installation. Create a new user and
password.Thenyou can install MariaDB with this command:

sudo apt install mariadb-server

Type “Y” and Enter to continue. After a few seconds, the installation process is complete and
MariaDB is almost ready to use. These installation of MariaDB has also installed the MariaDB
client.This will allow us to connect from the command line with mysql but by default, there is no
account available to connect.That’s why we need to create root access first.

Step 2:Get Root access

Define the password for the root user and start to use MariaDB: Enter this command:
sudo mysql_secure_installation

A message will appear

Press enter to continue (no password by default).

Press “Y” to switch to unix_socket authentication.

Then type “Y” to set a new password, and enter the password of your choice.

Now, press “Y” three more times to

Remove anonymous users.

Disallow root login remotely.

Remove the test database.

And finally, press “Y” again to reload the privileges.

Step 3:Bottom of Form

Connect with root now use the mysql command for your first connection:

Sudo mysql –u root -p

Then enter the password you have defined previously. And that’s it, you are connected to the
MySQL server. Once you are connected, you can use all the MySQL queries like these:

SHOW DATABASES;

USE <database>;

SHOW TABLES;
SELECT * FROM <table>;

UPDATE, INSERT, DELETE, …

Step 4:Create a new MariaDB user

It is recommended to use the root user for administration and debugging on a local usage. But
for any other applications, you will probably create new users, with access to only one specific
database.Create a new user on MariaDB Connect to the MySQL command line:
sudo mysql -uroot -p

CONCLUSION:

In this experiment we had seen how to install MariaDB on Raspberry Pi, and also how to
configure and manage it on a daily basis.

Output:

You might also like