Introduction:
MariaDB is a popular open-source relational database management system and a drop-in replacement for MySQL. If you’re running CentOS 8 and want to install MariaDB, this step-by-step guide will walk you through the installation process.
Step 1: Update System Packages
- Open a terminal on your CentOS 8 system.
- Update the system packages to their latest versions by running the following command:
sudo dnf update
Step 2: Install MariaDB
- Install the MariaDB server package by executing the following command:
sudo dnf install mariadb-server
2. Enter ‘y’ when prompted to confirm the installation.
3. Wait for the installation to complete.
Step 3: Start and Enable MariaDB
- Start the MariaDB service by running the following command:
sudo systemctl start mariadb
2. Enable the MariaDB service to start automatically on system boot:
sudo systemctl enable mariadb
Step 4: Secure MariaDB Installation
- Secure your MariaDB installation by running the following command:
sudo mysql_secure_installation
2. You will be prompted to set a password for the MariaDB root user. Choose a strong password and remember it for future use.
3. Follow the prompts to answer a series of security-related questions. It is recommended to answer ‘Y’ to all questions for improved security.
Step 5: Verify MariaDB Installation
- Check the status of the MariaDB service by executing the following command:
sudo systemctl status mariadb
If the service is active and running, it means MariaDB has been successfully installed.
2. You can also verify the installation by logging into the MariaDB shell:
sudo mysql -u root -p
- Enter the root password you set during the secure installation step. If you can access the MariaDB shell without any errors, it confirms a successful installation.
Conclusion:
By following the steps outlined in this article, you can easily install MariaDB on your CentOS 8 system. MariaDB is a robust and feature-rich database management system that can power your applications and store your data efficiently. Take advantage of the seamless compatibility with MySQL and leverage the extensive ecosystem of tools and libraries available for MariaDB. Enjoy the benefits of this open-source database solution for your CentOS 8 environment.