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

04 - MariaDB Create User and Database

The document describes an experiment to perform basic SQL commands on a MariaDB database installed on a Raspberry Pi. It outlines creating a new user, connecting as that user, and executing commands like SHOW DATABASES, USE, SHOW TABLES, and SELECT to view and interact with the database. The conclusion states the goal of creating a new user and table in the MariaDB database on the Raspberry Pi was achieved.

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)
83 views

04 - MariaDB Create User and Database

The document describes an experiment to perform basic SQL commands on a MariaDB database installed on a Raspberry Pi. It outlines creating a new user, connecting as that user, and executing commands like SHOW DATABASES, USE, SHOW TABLES, and SELECT to view and interact with the database. The conclusion states the goal of creating a new user and table in the MariaDB database on the Raspberry Pi was achieved.

Uploaded by

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

EXPERIMENT NO 03

TITLE : To perform the basic SQL commands on Rasberry Pi Using Maria DB..

AIM: To create new user and execute the basic SQL commands on Rasberry Pi Using Maria
DB..

SCOPE: Understand the user creation and database updation 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 is a popular fork of MySQL created by MySQL's original developers. It grew out
of concerns related to MySQL's acquisition by Oracle. It offers support for both small data
processing tasks and enterprise needs. It aims to be a drop-in replacement for MySQL
requiring only a simple uninstall of MySQL and an install of MariaDB. MariaDB offers the
same features of MySQL and much more.
Key Features of MariaDB
The important features of MariaDB are
All of MariaDB is under GPL, LGPL, or BSD.
MariaDB includes a wide selection of storage engines, including high-performance
storage engines, for working with other RDBMS data sources.
MariaDB uses a standard and popular querying language.
MariaDB runs on a number of operating systems and supports a wide variety of
programming languages.
MariaDB offers support for PHP, one of the most popular web development
languages.
MariaDB offers Galera cluster technology.
MariaDB also offers many operations and commands unavailable in MySQL, and
eliminates/replaces features impacting performance negatively.

Create a new user on MariaDB


Here is how to do this:

• Connect to the MySQL command line:


sudo mysql –uroot -p
• Create a new database:
CREATE DATABASE <dbname>;
In this step and the following, replace all variables between <…> by the name you want
to use
• Now, create the new user:
CREATE USER '<username>'@'localhost' IDENTIFIED BY '<password>';
• Then, allow this new user to do anything on the database we just created:
GRANT ALL PRIVILEGES ON <dbname>.* TO '<username>'@'localhost';
• Finally, reload the permissions with:
FLUSH PRIVILEGES;
• Test the connection you can now check that everything works fine with:
sudo mysql -u<username> -p
And use the password you just created.

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, …
CONCLUSION:

In this experiment we had seen how to create new user and table in database MariaDB on
Raspberry Pi.

OUTPUT:

You might also like