
MariaDB is an open-source drop-in replacement for MySQL that offers increased efficiency, and improved database performance with support for a wide range of data types using multiple storage engines. MariaDB uses SQL (Structured Query Language) to manage and manipulate information in relational databases. This article explains how to install MariaDB on Rocky Linux 9 and set up databases on your server.
Before you begin:
MariaDB is available in the default repositories on Rocky Linux 9. In the following steps, verify the available packages and install MariaDB on your server.
Search all available MariaDB packages in the default DNF repositories.
Output:
Install MariaDB on your server.
Verify the installed MariaDB version on your server.
Output:
Enable the MariaDB service to automatically start at boot.
Output:
Start the MariaDB service:
Stop the MariaDB service:
Restart the MariaDB service:
View the MariaDB service status and verify that it's running.
Your output should be similar to the one below:
The MariaDB package includes the mysql_secure_installation script used to disable default configurations and secure your MariaDB server. Follow the steps below to run the script and enable secure authentication for all database users on your server.
Run the secure installation script.
Log in to the MariaDB console as the root database user.
Enter the root user password you set earlier to access the database console.
Create a new sample database example-vultr.
View all databases on the server and verify the new database is available.
Output:
Create a new database user with a strong password. For example, vultr_user.
Grant the user full privileges to the example_vultr database.
Refresh the MariaDB privilege tables to apply the new user changes.
Exit the MariaDB console.
Log in to the MariaDB console using the new database user and password.
You have installed MariaDB on your Rocky Linux 9 server and secured the database server to enable the creation of relational databases. MariaDB integrates with other applications on your server using modules compatible with MySQL. For more information and configuration options, please visit the official MariaDB documentation.
0 Comments
Be the first to comment and share your perspective with the community.