$ sudo dnf update -y<\/code><\/pre>\n\n\n\nStep 2: Add the MariaDB Repository<\/h2>\n\n\n\n MariaDB is not included in the default Rocky Linux repositories, so you need to add the MariaDB repository to your system.<\/p>\n\n\n\n
First, create a new repo file for MariaDB:<\/p>\n\n\n\n
$ sudo nano \/etc\/yum.repos.d\/MariaDB.repo<\/code><\/pre>\n\n\n\nAdd the following content to the file:<\/p>\n\n\n\n
# MariaDB 11.5.1 CentOS repository list - created 2024-06-17 10:00 UTC\n# http:\/\/downloads.mariadb.org\/mariadb\/repositories\/\n[mariadb]\nname = MariaDB\nbaseurl = http:\/\/yum.mariadb.org\/11.5.1\/centos8-amd64\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1<\/code><\/pre>\n\n\n\nSave and close the file by pressing Ctrl + X<\/code>, then Y<\/code>, and Enter<\/code>.<\/p>\n\n\n\nStep 3: Install MariaDB<\/h2>\n\n\n\n With the repository added, you can now install MariaDB using the dnf<\/code> package manager.<\/p>\n\n\n\nbashCopy codesudo dnf install MariaDB-server MariaDB-client -y\n<\/code><\/pre>\n\n\n\n$ sudo dnf install MariaDB-server MariaDB-client -y<\/code><\/pre>\n\n\n\nStep 4: Start and Enable MariaDB<\/h2>\n\n\n\n After installation, start the MariaDB service and enable it to start on boot.<\/p>\n\n\n\n
$ sudo systemctl start mariadb\n$ sudo systemctl enable mariadb<\/code><\/pre>\n\n\n\nYou can verify that MariaDB is running with the following command:<\/p>\n\n\n\n
$ sudo systemctl status mariadb<\/code><\/pre>\n\n\n\nStep 5: Secure the MariaDB Installation<\/h2>\n\n\n\n MariaDB includes a security script to improve the security of your installation. Run the script to set the root password, remove anonymous users, disallow remote root login, and remove the test database.<\/p>\n\n\n\n
$ sudo mysql_secure_installation<\/code><\/pre>\n\n\n\nYou will be prompted to enter the current root password, which is blank by default. Just press Enter<\/code>. Then follow the prompts to set a root password and answer Y<\/code> (yes) to all the subsequent questions.<\/p>\n\n\n\nStep 6: Verify the Installation<\/h2>\n\n\n\n To verify that MariaDB is installed and working correctly, log in to the MariaDB shell using the root user.<\/p>\n\n\n\n
$ sudo mysql -u root -p<\/code><\/pre>\n\n\n\nEnter the root password you set earlier. If you successfully log in, you should see the MariaDB shell prompt:<\/p>\n\n\n\n
Welcome to the MariaDB monitor. Commands end with ; or \\g.\nYour MariaDB connection id is 10\nServer version: 11.5.1-MariaDB MariaDB Server<\/code><\/pre>\n\n\n\nYou can also check the MariaDB version:<\/p>\n\n\n\n
SELECT VERSION();<\/code><\/pre>\n\n\n\nThis should return 11.5.1<\/code>.<\/p>\n\n\n\nStep 7: Create a Database (Optional)<\/h2>\n\n\n\n To create a new database and user, you can use the following commands within the MariaDB shell:<\/p>\n\n\n\n
CREATE DATABASE mydatabase;\nCREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';\nGRANT ALL PRIVILEGES ON mydatabase.* TO 'myuser'@'localhost';\nFLUSH PRIVILEGES;<\/code><\/pre>\n\n\n\nReplace mydatabase<\/code>, myuser<\/code>, and mypassword<\/code> with your desired database name, username, and password.<\/p>\n\n\n\nConclusion<\/h2>\n\n\n\n You have successfully installed MariaDB 11.5.1 on Rocky Linux 8.10. MariaDB is now ready to use for your applications. For more advanced configurations and optimizations, refer to the official MariaDB documentation.<\/p>\n\n\n\n
By following these steps, you ensure that your database setup is secure and ready for production use.<\/p>\n","protected":false},"excerpt":{"rendered":"
MariaDB is a popular open-source relational database management system that is widely used for its performance, scalability, and robust feature set. Installing MariaDB 11.5.1 on Rocky Linux 8.10 is a…<\/p>\n","protected":false},"author":1,"featured_media":14334,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,28,16,18],"tags":[],"yoast_head":"\n
How to Install MariaDB 11.5.1 on Rocky Linux 8.10 Systems<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n