Data is the most important part of any application and must be stored permanently. So database is used to store application data. MariaDB is one of the popular databases and a branch of the MySQL database. MariaDB has its own features and capabilities. In this article, we are going to teach you How to Install MariaDB on Arch Linux. If you want to buy a Linux VPS server, you can visit the plans offered on the Eldernode website.
Table of Contents
How to Setup MariaDB on Arch Linux
What is MariaDB?
MariaDB is an open-source relational database that can be used programmatically and at no cost to store important data, and is an improved version of MySQL. Any program or script can be used to connect to the database.
The default MYSQL database client is MariaDB. A connection to the MariaDB database can be made from the terminal using the client and any graphical user interface (GUI) tool to communicate with the MariaDB database, such as phpMyAdmin. Additionally, you can use any server-side programming language such as PHP, Perl, and Python to communicate with the MariaDB database.
Important features of MariaDB
MariaDB has capabilities and features, the most important of which are mentioned below:
1- This database is open-source and licensed under GPL or LGPL or BSD.
2- It is powerful and scalable.
3- It uses common and standard query language.
4- Various operating systems support it.
5- It can be used with different programming languages.
6- Automatically updates the index.
7- It supports many programming languages and Galera cluster technology.
Installing MariaDB on Arch Linux
In the first step to install MariaDB on Arch Linux, it is necessary to update the Arch Linux packages by running the following command:
Now you can reboot the system by running the following command to apply the changes:
In the next step, you can install the MariaDB package using the following command:
pacman -Sy mariadb
The important thing to note is that you must initialize the database with the following command before starting the MariaDB service:
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Now you need to start MariaDB by running the following command:
systemctl start --now mariadb
You can also enable MariaDB by running the following command:
systemctl enable --now mariadb
Finally, you can check the installation status by running the following command:
systemctl status mariadb
To remove anonymous users, test the database and prohibit remote root access, you can use the following command:
In the continuation of the installation process, if you encounter the following questions, you must type the appropriate answer for each question according to the following commands:
Enter current password for root (enter for none): << Just press enter
Switch to unix_socket authentication [Y/n] N
Change the root password? [Y/n] Y
New password: << Enter Password
Re-enter new password: << Re-Enter Password
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
How to Access MariaDB on Arch Linux
After you have successfully installed MariaDB on Arch Linux, now in this step we want to show you how to access MariaDB. To do this, just run the following command:
mysql -u root -p
Note: You can access MariaDB using MySQL root password.
The MariaDB database has many features that make it one of the most popular databases among web designers. In this article, we tried to teach you How to Install MariaDB on Arch Linux. If you have any questions, you can ask us in the comments section.