May 26.2021Raspberry Pi written by Razvan Iancu
We suggest you learn how to install and configure MariaDB, a popular MySQL relational database management system.
MariaDB is a database management system, used as an alternative to MySQL which belonged to the popular LAMP Stack. This software is developed by a community and was designed to remain highly compatible with MySQL, although there are some incompatibilities.
This tutorial will describe how to install MariaDB on an ARM system, we tested it on Twister OS ARM.
Download Twister OS ARM
1. Install MariaDB from Linux packages
In Twister, MariaDB is available directly from the default repositories. We will use apt for this task.
First update of data from apt repositories by:
$ sudo apt update
After updating the repository data, run:
$ sudo apt install mariadb-server mariadb-client
This command will install MariaDB and the necessary packages. Confirm with 'Y' for any requests you receive.
2. Installation testing and verification
After installing the packages from the default repositories, MariaDB will launch automatically. To test it, check its condition.
$ sudo systemctl status mariadb
If you have checked the installation but MariaDB does not work, you can start it with the commands below.
$ sudo systemctl start mariadb.service
$ sudo systemctl enable mariadb.service
3. Configure and secure MariaDB
The first step after verifying the status and setting up the MariaDB service, you need to secure its activity by setting a root password
, disabling remote root login data, deleting the test database, and deleting it. all anonymous users.
Run the command below to secure MariaDB
You can follow the recommendations made, unless you want another configuration.Enter current password for root (enter for none): (ENTER)
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
To check the MariaDB configuration, run this command
sudo mysqladmin -u root -p version
4. Configure root that uses password authentication
To do this, open the MariaDB prompt in the terminal
$ sudo sudo mariadb -u root -p
Now create root privileges and password access ('password' is the password entered when securing MariaDB)
MariaDB[(none)]> GRANT ALL ON *. * TO 'root @ localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Clear privileges to make sure they are saved and available in the current session:
MariaDB[(none)]> FLUSH PRIVILEGES;
Then exit MariaDB:
5. Connect MariaDB to a database management software
We offer DbGate, which is a free and modern database management alternative for Microsoft SQL Server, PostgreSQL, MySQL and MongoDB or MariaDB.
DbGate offers a comprehensive set of functions for managing the content of databases, such as table navigation and viewing, as well as querying, table modification, and more.Download DbGate
6. In conclusionMariaDB is one of the ideal solutions when it comes to relational databases.
In this guide we have shown you how to install the MariaDB relational database management system and secure it using the mysql_secure_installation installation script. You also had the option to set up an administrative user who uses password authentication.