MariaDB is an open-source, powerful, and highly reliable relational database management system (RDBMS) that is derived from the MySQL database system. It has gained immense popularity among developers and is widely used as a drop-in replacement for MySQL due to its enhanced features, improved performance, and compatibility. In this tutorial, we will walk you through the process of how to install MariaDB server on Oracle Linux.
Prerequisites
Before you proceed, ensure that you have the following:
- A running instance of Oracle Linux (7 or 8)
- A Root user or account with sudo privileges
- A stable internet connection
How to Install MariaDB Server on Oracle Linux
Update the System
First and foremost, you need to update your Oracle Linux system. This ensures that you have the latest security patches and package updates. Run the following command to update your system:
sudo yum update -y
Add the MariaDB Repository
By default, Oracle Linux does not include the MariaDB repository in its software sources. Therefore, you need to add the official MariaDB repository to your system. Follow the steps below:
- Install the MariaDB repository package by running:bash
sudo yum install -y https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
Run the MariaDB repository setup script:
sudo mariadb_repo_setup
Verify that the repository was added successfully by checking the list of enabled repositories:
sudo yum repolist
You should see the MariaDB repository in the output.
Install MariaDB Server and Client
With the MariaDB repository added, you can now proceed to install the MariaDB server and client packages. Run the following command:
sudo yum install -y mariadb-server mariadb-client
Start and Enable the MariaDB Service
After installing MariaDB, you need to start the service and enable it to run automatically at system boot. Use the following commands:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Secure the MariaDB Installation
MariaDB comes with a security script that helps you improve the security of your database server. Run the following command to start the script:
sudo mysql_secure_installation
Follow the on-screen prompts to set a root password, remove anonymous users, disable remote root login, and remove the test database.
Verify the MariaDB Installation
To verify that MariaDB is running and functioning correctly, run the following command:
sudo mysql -u root -p
Enter your root password when prompted, and you should be greeted with the MariaDB command prompt.
Optional: Install phpMyAdmin
If you prefer to manage your MariaDB server using a web interface, you can install phpMyAdmin by following this tutorial on how to install phpMyAdmin on Rocky Linux.
Conclusion
Congratulations! You have successfully installed MariaDB server on your Oracle Linux system. You can now proceed to create databases, users, and tables, as well as manage your data with ease. For more tutorials on Oracle Linux, check out the following articles: