How to Install MariaDB on AlmaLinux 8 / RHEL 8

How to Install MariaDB on AlmaLinux 8 / RHEL 8

Choosing the right database for your application is not an easy task, but it is vital to the success of the application. MariaDB is a drop-in replacement for MySQL with additional features and better performance. Learn how to install or upgrade mariadb on CentOS 8 / RHEL 8 in this post!

Introduction

MariaDB is a free and open source relational database management system. It is a fork of the popular MySQL database system. MariaDB is compatible with MySQL, which means that it can use all of the existing MySQL databases and tools. MariaDB is widely used in both production and development environments.

CentOS and RHEL are two popular Linux distributions. Both distributions use the RPM Package Manager (RPM) to install, update, and remove software packages. MariaDB is available in the RPM repository for both distributions.

In this guide, we will show you how to install MariaDB on CentOS 7 and RHEL 7. We will also show you how to create a new database and user, and how to grant privileges to the user.

Adding MariaDB Repository to Yum

To add the MariaDB repository to yum, you will need to install the MariaDB RPM package from the MariaDB website. You can do this by running the following command:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

After running this command you will be able to install the latest version of MariaDB from the official MariaDB repository.

Installing MariaDB Server

Once the repository has been added, you can install MariaDB by running the following command:

yum install MariaDB-server MariaDB-client

How to Enable MariaDB Service to Start At Boot

To enable the MariaDB service to start automatically at boot, you’ll need to use the chkconfig command. You can do this by running the following command:

systemctl enable mariadb

This will enable the MariaDB service to start automatically whenever the server is rebooted.

How to Start MariaDB Service

The first thing you need to do is start the MariaDB service. You can do this by running the following command:

systemctl start mariadb

How to Secure MariaDB Server Installation

It is important to secure your MariaDB server installation to protect your data from being accessed by unauthorized users. One way to do this is to set a password for the root user. You can do this by running the following command:

mysql_secure_installation

Answer the questions the prompt gives you for best experience.
You will be prompted to enter a password for the root user, put your password there and make sure you copy it to a safe location, so you will not lose it.

Adding a New Database to The MariaDB Server

Adding a new database to the MariaDB server is a simple process. First, log in to the MariaDB server as root. Then, create a new database using the “CREATE DATABASE” command. For example, to create a new database named “new_db”, you would use the following command:

CREATE DATABASE new_db;

Creating a User And Granting It Permissions

In order to create a new user, log into the MariaDB shell as the root user and running the following commands:

Creating the user “new_user” and the password “password”:

CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';

Granting permissions for the new user on the new database:

GRANT ALL PRIVILEGES ON new_db.* TO 'new_user'@'localhost' IDENTIFIED BY 'password';

Flushing privileges (saves privileges):

FLUSH PRIVILEGES;

Conclusion

In this article, we have shown you how to install MariaDB on a AlmaLinux 8 or RHEL 8 server.
We also showed you how to create a new database and user, and how to grant the user permissions to access the database. Once you have MariaDB installed and configured on your server, you can begin working with databases and tables. Thanks for reading!

MySQL vs MariaDB: Which is the Right Database for Your Business?

MySQL vs MariaDB: Which is the Right Database for Your Business?

There are many factors to consider when choosing a database for your business. Two of the most popular databases are MySQL and MariaDB. Both databases are open source and have a large community of users and developers. MariaDB is a fork of MySQL, and both databases are widely used in web applications. However, there are some differences between the two databases that you should be aware of. MySQL is owned by Oracle, while MariaDB is developed by the original developers of MySQL. MariaDB is compatible with all major Linux distributions, while MySQL is only compatible with some. MariaDB has a number of storage engines that are not available in MySQL. MariaDB also supports a wider range of character sets and has better performance on certain workloads. When deciding which

MySQL

-Pros:
-Owned by Oracle
-Can use InnoDB storage engine
-Wider range of character sets

-Cons:
-Not compatible with all major Linux distributions

MariaDB

-Pros:
-Developed by original developers of MySQL
-Fork of MySQL, compatible with all major Linux distributions
-InnoDB is the default storage engine
-Number of storage engines not available in MySQL
-Wider range of character sets
-Better performance on certain workloads

-Cons:

-Owned by Oracle-not a 100% open source 

-Differences in versions in earlier releases 

When should I use MySQL vs MariaDB?

When building a new web application, you should use MySQL instead of MariaDB if:

You plan to use InnoDB as your storage engine

You want compatibility with most major Linux distributions

You want to use a character set that uses multi-byte encoding (such as Chinese, Japanese, or Korean)

You want a more mature community and more support options

You should use MariaDB instead of MySQL if: 

You plan to use another storage engine, such as Memory, Memory of Shared Memory, Fileakuya, or Aria

You want a more modern database (MariaDB is two years younger than MySQL)

You need to support client-side character sets that are larger than255 bytes

Your applications perform better on full-text search that is built 

If you’re looking for a database that is compatible with all major Linux distributions, has better performance on certain workloads, and supports a wider range of character sets, then MariaDB is the right database for your business.

Conclusion

If you’re looking for a reliable and scalable database for your business, then MariaDB is the right choice. It is compatible with all major Linux distributions, supports a wide range of character sets, and has better performance on certain workloads. If you’re looking for a database that is easy to use and has a large community of users and developers, then MySQL is the right database for your business. However, if you’re looking for a database that is more stable and scalable, then MariaDB is the right choice.

When deciding which database to use for your business, it is important to consider your needs and the features of each database. If you need a database that is compatible with all major Linux distributions, then MariaDB is the right choice. If you need a database with a wide range of character sets and better performance on certain workloads, then MariaDB is also the right choice. However, if you need a database that is owned by Oracle and is only compatible with some Linux distributions, then MySQL is the right choice.