The database is one of the primary and most essential elements any software needs to work. A website, a simple mobile application, an operating system, or an accounting application that is supposed to work with specific data, content, or information needs a database to store this information in a systematic classification for use in the application. MariaDB is one such database. For this reason, in this article, we are going to learn how to install MariaDB on AlmaLinux 9.
An introduction to MariaDB and its functionality
MariaDB is a professional database that can fully cover your database needs. Many of the big names in the world of software and the internet have changed their process and addressed the users of this powerful database. MariaDB is a well-rooted database that has evolved from one of the most powerful databases out there.
What sets MariaDB apart from MYSQL, and the reason why users forgo the professional and high-level support of a company like Oracle and choose MariaDB for their application or site, are the optimizations that MariaDB provides. These optimizations will greatly increase the convenience of working with this database, increase security, and also increase the speed of operation, which will increase the overall efficiency of MariaDB.
Features of MariaDB
- This database is open-source and licensed under GPL or LGPL or BSD.
- It is powerful and scalable.
- It uses common and standard query language.
- Various operating systems support it.
- It can be used with different programming languages.
- Automatically updates the index.
- It supports many programming languages and Galera cluster technology.
- A Linux VPS Server with AlmaLinux OS
How to Install MariaDB on AlmaLinux 9
You can install MariaDB by running the following command:
yum install mariadb-server
After executing the above command, you can now check the version of MariaDB using the command below:
In the next step, it is necessary to start MariaDB with the help of the following command:
systemctl start mariadb
It is also necessary to enable MariaDB using the following command:
systemctl enable mariadb
After completing the mentioned steps, you can check the status of MariaDB:
systemctl status mariadb
Configuring MariaDB on AlmaLinux
In the previous section, you saw the MariaDB installation steps. Now we are going to teach you how to secure your MariaDB server. To do this, in the first step, you must execute the following command:
In the next step, you need to log in to the MariaDB server using the following command and the password you set earlier:
mysql -u root -p
It’s time to create a database and user. Be careful that you need to add the desired user to the database.
Tip: In this post, we name the database neuronvm and the user name nvmuser.
mysql -u root -p
Create the database by running the following command:
CREATE DATABASE neuronvm;
You can also create a user by running the following command:
CREATE user nvmuser;
Finally, you can add the user to the database using the following command:
GRANT ALL ON neuronvm.* TO nvmuser@localhost IDENTIFIED BY 'secretePasswordHere';
It should be noted that you can easily access MariaDB using the following command:
mysql -u nvmuser -p'secretePasswordHere' neuronvm
After entering MariaDB, you can see the list of databases with the help of the following command:
MariaDB [neuronvm]> show databases;
Excellent! You can easily install MariaDB on AlmaLinux 9. As mentioned earlier, the MariaDB database is an open-source relational database management system (DBMS) that is an alternative to MySQL database technology. If you have any questions while installing MariaDB, you can ask us in the comments section.