03 MariaDB
03 MariaDB
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:
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
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.
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
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:
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.
Define the password for the root user and start to use MariaDB: Enter this command:
sudo mysql_secure_installation
Then type “Y” to set a new password, and enter the password of your choice.
Connect with root now use the mysql command for your first connection:
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>;
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: