MariaDB is the fork of the popular MySQL Database management system that can be easily installed on Amazon Linux 2023 using the default repositories. It is also open source and almost all server Linux distros made it available readily for users because MariaDB has gained significant traction due to its performance, reliability, and ease of use. Whether you’re setting up a web application, managing data for your business, or exploring databases, this comprehensive tutorial will help you get started.
So, in this let’s see what are the steps and commands we need to follow for the installation of MariaDB on Amazon Linux 2023.
We don’t need any specific requirements for following this tutorial, just the common things – first is ofcourse Amazon Linux, and second sudo rights to install packages.
Step 1: Perform Al2023 Package Update
First either visit the AWS Cloud dashboard to directly connect and access your Amazon Linux 2023 command terminal or use the SSH to establish a remote connection.
After that, first, run the system update command:
sudo dnf update
Step 2: Install MariaDB 10.05 on Amazon Linux 2023
Unlike MySQL Database system which is not available in Amazon Linux 2023 via the default system repositories, MariaDB is there, hence can be installed without adding any additional stuff on our Linux server.
Just use the DNF package to run the given command:
sudo dnf install mariadb105-server
The above command will install the following packages on your system:
Installing weak dependencies:
Step 3: Start and Enable MariaDB
Once the installation is completed, start the MariaDB service using the following command because it wouldn’t be automatic.
sudo systemctl start mariadb
Whereas, to also ensure MariaDB starts automatically on system boot or in case of a crash, enable it using:
sudo systemctl enable mariadb
To check the status of the MariaDB service status:
sudo systemctl status mariadb
Step 4: Secure MariaDB Installation
Being a fork of MySQL, MariaDB also has a security script that can help users to increase the security of the Database server by setting up a root password, removing anonymous users, and more.
Run the script:
Follow the prompts to configure your security preferences. You’ll be asked to set the root password, remove anonymous users, disallow root login remotely, remove the test database, and reload privilege tables.
Step 5: Accessing MariaDB
You can now access MariaDB using the MySQL command-line client:
mysql -u root -p
Enter the root password you set during the secure installation step.
As you have seen installing MariaDB on Amazon Linux 2023 is not much complicated at all, we can get it using a simple command. After that you will have a reliable but powerful database management system for your websites, CMS, or any other web application for storing, retrieving, and managing your data for various applications.