{"id":16653,"date":"2026-05-17T16:49:01","date_gmt":"2026-05-17T16:49:01","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=16653"},"modified":"2026-05-17T16:49:07","modified_gmt":"2026-05-17T16:49:07","slug":"how-to-install-and-secure-mysql-mariadb-on-almalinux-10","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/","title":{"rendered":"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide)"},"content":{"rendered":"\n<p>One of the most vulnerable resources is an unprotected, installed database server. Database attacks continue to be one of the three most recurring causes of enterprise data breaches year after year, and most of the attacks take advantage of misconfigurations that could have been avoided during initial setup in less than 30 minutes, according to <a href=\"https:\/\/www.verizon.com\/business\/resources\/reports\/dbir\/\">Verizon&#8217;s Data Breach Investigations Report<\/a>.<\/p>\n\n\n\n<p><a href=\"https:\/\/almalinux.org\/get-almalinux\/\">AlmaLinux 10<\/a> is an enterprise Linux distribution based on RHEL with support from Red Hat, and is popular with companies moving away from CentOS. It ships with MariaDB as the default database engine, which is a fully open source, production-proven derivative of MySQL, compatible with MySQL binary-wise, and is maintained by the MariaDB Foundation.<\/p>\n\n\n\n<p>In this guide, you&#8217;ll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-16653-_uzgdnuo5c536\"><\/a><strong>What Is MariaDB and Why Is It the Default on AlmaLinux 10?<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/mariadb.com\/downloads\/\">MariaDB<\/a> is a community-developed drop-in replacement for MySQL developed by the original MySQL developers since Oracle bought Sun Microsystems in 2010. It is a fully wired protocol compatible with MySQL, which means that any MySQL client, connector, or application can run on it without requiring any changes.<\/p>\n\n\n\n<p>With AlmaLinux 10, the default version of the MariaDB database engine is pre-installed in the official AlmaLinux AppStream repository, as it provides better performance in some workloads, a more active open source community, and a development roadmap that focuses on enterprise reliability. All commands, SQL syntax, and configuration file locations (e.g., \/etc\/my.cnf) that are discussed in this guide are applicable to both <a href=\"https:\/\/greenwebpage.com\/community\/how-to-install-mysql-on-debian-12\/\">MySQL<\/a> and MariaDB when using AlmaLinux 10.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-16653-_clu4elppn2hi\"><\/a><strong>Expert Guide: Install and Secure MySQL\/MariaDB on AlmaLinux 10<\/strong><\/h2>\n\n\n\n<p>A full installation guide for MySQL\/MariaDB, installation of secure authentication, allowing firewall access, and hardening up your AlmaLinux 10 database server. Learn how to properly secure the MySQL\/MariaDB database on AlmaLinux 10 systems, including: how to protect the root password, how to remove anonymous users, how to disable remote root access, and how to configure the database for production use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_jelhtyiop9qw\"><\/a><strong>Step 1: Update the System and Verify the Environment<\/strong><\/h3>\n\n\n\n<p>You should keep your <a href=\"https:\/\/greenwebpage.com\/community\/how-to-install-almalinux-10-on-vmware-workstation\/\">AlmaLinux 10 operating system<\/a> up-to-date before installing any new server software. If you install on a fully-updated system, you have no uncertainty as to how the new packages will behave, pending kernel updates and security patches:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo dnf update<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1121\" height=\"237\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-1.png\" alt=\"sudo dnf update\" class=\"wp-image-16654\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-1.png 1121w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-1-300x63.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-1-1024x216.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-1-768x162.png 768w\" sizes=\"(max-width: 1121px) 100vw, 1121px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/greenwebpage.com\/community\/how-to-check-almalinux-version\/\">Check your version of AlmaLinux<\/a>, and ensure you are logged on as a user who has sudo privileges:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>cat \/etc\/almalinux-release<\/p>\n<p>whoami<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1104\" height=\"233\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-2.png\" alt=\"cat \/etc\/almalinux-release\" class=\"wp-image-16655\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-2.png 1104w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-2-300x63.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-2-1024x216.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-2-768x162.png 768w\" sizes=\"(max-width: 1104px) 100vw, 1104px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_7yek0pbgqzcf\"><\/a><strong>Step 2: Install MariaDB on AlmaLinux 10<\/strong><\/h3>\n\n\n\n<p>MariaDB can be obtained directly from the AlmaLinux 10 AppStream repository. Install both the server and client packages with one dnf command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo dnf install mariadb-server mariadb<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1123\" height=\"448\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-3.png\" alt=\"sudo dnf install mariadb-server mariadb\" class=\"wp-image-16656\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-3.png 1123w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-3-300x120.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-3-1024x409.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-3-768x306.png 768w\" sizes=\"(max-width: 1123px) 100vw, 1123px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Check the installed version:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>mariadb &#8211;version<\/p>\n<p>mysql &#8211;version<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1129\" height=\"261\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-4.png\" alt=\"mariadb --version\" class=\"wp-image-16657\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-4.png 1129w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-4-300x69.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-4-1024x237.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-4-768x178.png 768w\" sizes=\"(max-width: 1129px) 100vw, 1129px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>On AlmaLinux 10, both mariadb and mysql execute the same binary, and scripts and tools that are dependent on either command name are backwards compatible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_xraqxu95czgr\"><\/a><strong>Step 3: Start and Enable the MariaDB Service<\/strong><\/h3>\n\n\n\n<p>Now we can start and enable the MariaDB Service. Start MariaDB, and configure it to start automatically on boot:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo systemctl enable mariadb &#8211;now<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1127\" height=\"288\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-5.png\" alt=\"sudo systemctl enable mariadb --now\" class=\"wp-image-16658\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-5.png 1127w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-5-300x77.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-5-1024x262.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-5-768x196.png 768w\" sizes=\"(max-width: 1127px) 100vw, 1127px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Verify the service is running:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo systemctl status mariadb<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1131\" height=\"576\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-6.png\" alt=\"sudo systemctl status mariadb\" class=\"wp-image-16659\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-6.png 1131w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-6-300x153.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-6-1024x522.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-6-768x391.png 768w\" sizes=\"(max-width: 1131px) 100vw, 1131px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Confirm MariaDB is listening on port 3306:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>ss -tlnp | grep 3306<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1112\" height=\"166\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-7.png\" alt=\"ss -tlnp | grep 3306\" class=\"wp-image-16660\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-7.png 1112w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-7-300x45.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-7-1024x153.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-7-768x115.png 768w\" sizes=\"(max-width: 1112px) 100vw, 1112px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The binding 127.0.0.1:3306 is a crucial security aspect; it guarantees that MariaDB is only accepting connections from the local machine, not from any external network interface.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_6pa5to815vhm\"><\/a><strong>Step 4: Run the Security Installation Script<\/strong><\/h3>\n\n\n\n<p>MariaDB comes with a security script called mysql_secure_installation, which will ask you questions and guide you through the most important initial steps of securing MariaDB interactively. Run it now:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo mysql_secure_installation<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1119\" height=\"408\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-8.png\" alt=\"sudo mysql_secure_installation\" class=\"wp-image-16661\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-8.png 1119w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-8-300x109.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-8-1024x373.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-8-768x280.png 768w\" sizes=\"(max-width: 1119px) 100vw, 1119px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The following prompts are given in the script. These are the proper answers for a production server: You will be presented with the root password. You will be asked for the current root password.<\/p>\n\n\n\n<p>If you answer Y to &#8220;Remove anonymous users&#8221;, any account that allows anyone to log in to MariaDB without a password will be deleted, something that is not acceptable on any server that is connected to a network. If you set the answer to Y for &#8220;Disallow root login remotely,&#8221; then even if an attacker knows the root password, he cannot log in to the system remotely. If you choose Y for &#8220;Remove test database&#8221;, you will get rid of a publicly writable database supplied by default, which is a known attack surface for which there are several CVEs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_uzx4ll7hef1h\"><\/a><strong>Step 5: Verify Security Hardening Applied<\/strong><\/h3>\n\n\n\n<p>Once you have run mysql_secure_installation, check that every security step was executed properly by directly checking the MariaDB system tables:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>mysql -u root -p<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1124\" height=\"386\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-9.png\" alt=\"sudo mysql -u root -p\" class=\"wp-image-16662\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-9.png 1124w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-9-300x103.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-9-1024x352.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-9-768x264.png 768w\" sizes=\"(max-width: 1124px) 100vw, 1124px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Use the MariaDB shell to run these verification queries. Run the following command to check all users\/password status:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>SELECT User, Host, authentication_string FROM mysql.user;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1125\" height=\"388\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-10.png\" alt=\"select user, host, authentication_string from mysql.user;\" class=\"wp-image-16663\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-10.png 1125w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-10-300x103.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-10-1024x353.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-10-768x265.png 768w\" sizes=\"(max-width: 1125px) 100vw, 1125px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Verify: 0 anonymous users<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>SELECT COUNT(*) AS anonymous_users FROM mysql.user WHERE User=&#8221;;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1133\" height=\"358\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-11.png\" alt=\"select count (*) as anonymous_users from mysql.user where user= '';\" class=\"wp-image-16664\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-11.png 1133w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-11-300x95.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-11-1024x324.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-11-768x243.png 768w\" sizes=\"(max-width: 1133px) 100vw, 1133px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Verify: 0 remote root access<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>SELECT COUNT(*) AS remote_root FROM mysql.user<\/p>\n<p>WHERE User=&#8217;root&#8217; AND Host NOT IN (&#8216;localhost&#8217;,&#8217;127.0.0.1&#8242;,&#8217;::1&#8242;);<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1127\" height=\"334\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-12.png\" alt=\"select count (*) as remote_root from mysql.user -&gt; where user = 'root' and host in ('localhost', '127.0.0.1', '::1');\" class=\"wp-image-16665\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-12.png 1127w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-12-300x89.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-12-1024x303.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-12-768x228.png 768w\" sizes=\"(max-width: 1127px) 100vw, 1127px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Verify: test database removed<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>SELECT COUNT(*) AS test_db FROM information_schema.SCHEMATA<\/p>\n<p>WHERE SCHEMA_NAME=&#8217;test&#8217;;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1114\" height=\"356\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-13.png\" alt=\"select count (*) as test_db from information_schema.schemata where schema_name = 'test'\" class=\"wp-image-16666\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-13.png 1114w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-13-300x96.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-13-1024x327.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-13-768x245.png 768w\" sizes=\"(max-width: 1114px) 100vw, 1114px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The three checks return the appropriate results: zero anonymous users, zero remote root access, and zero test databases. You have now hardened your MariaDB installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_hu5bsig241as\"><\/a><strong>Step 6: Create a Dedicated Application Database and User<\/strong><\/h3>\n\n\n\n<p>The most common and risky misconfiguration of MariaDB is to allow apps to log in directly to the root account. The root user has complete access to all databases on the server. If an application with root access is compromised, the attacker immediately has all access rights to all databases.<\/p>\n\n\n\n<p>The proper way is to establish a separate database and <a href=\"https:\/\/greenwebpage.com\/community\/how-to-schedule-tasks-using-cron-in-almalinux-10\/\">assign a dedicated user<\/a> to it with just the necessary level of access for that application:<\/p>\n\n\n\n<p>Create the application database with UTF-8 encoding.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>CREATE DATABASE appdb<\/p>\n<p>CHARACTER SET utf8mb4<\/p>\n<p>COLLATE utf8mb4_unicode_ci;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1104\" height=\"228\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-14.png\" alt=\"create dabatase appdb -&gt; character set utf8mb4 -&gt; collate utf8mb4 unicode_ci;\" class=\"wp-image-16667\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-14.png 1104w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-14-300x62.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-14-1024x211.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-14-768x159.png 768w\" sizes=\"(max-width: 1104px) 100vw, 1104px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Create a dedicated application user.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>CREATE USER &#8216;appuser&#8217;@&#8217;localhost&#8217;<\/p>\n<p>IDENTIFIED BY &#8216;AppUserStr0ngP@ss!&#8217;;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1107\" height=\"208\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-15.png\" alt=\"create user 'appuser' @ 'localhost' -&gt; identified by 'appuserstrongp@ass!';\" class=\"wp-image-16668\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-15.png 1107w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-15-300x56.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-15-1024x192.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-15-768x144.png 768w\" sizes=\"(max-width: 1107px) 100vw, 1107px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Grant only the privileges this application actually needs.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER<\/p>\n<p>ON appdb.*<\/p>\n<p>TO &#8216;appuser&#8217;@&#8217;localhost&#8217;;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1135\" height=\"263\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-16.png\" alt=\"grant select, insert, update, delete, create, drop, index, alt er\" class=\"wp-image-16669\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-16.png 1135w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-16-300x70.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-16-1024x237.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-16-768x178.png 768w\" sizes=\"(max-width: 1135px) 100vw, 1135px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Apply the privilege changes immediately.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>FLUSH PRIVILEGES;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1132\" height=\"177\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-17.png\" alt=\"flush privileges;\" class=\"wp-image-16670\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-17.png 1132w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-17-300x47.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-17-1024x160.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-17-768x120.png 768w\" sizes=\"(max-width: 1132px) 100vw, 1132px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Verify the grants were applied correctly:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>SHOW GRANTS FOR &#8216;appuser&#8217;@&#8217;localhost&#8217;;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1131\" height=\"551\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-18.png\" alt=\"show grants for 'appuser' @ 'localhost';\" class=\"wp-image-16671\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-18.png 1131w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-18-300x146.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-18-1024x499.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-18-768x374.png 768w\" sizes=\"(max-width: 1131px) 100vw, 1131px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The first line contains GRANT USAGE ON *.* \u2014 MariaDB does not allow the user to be created without having any privileges whatsoever. All permissions are given only to the appdb database, following the principle of least privilege.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_276kgzj2dl05\"><\/a><strong>Step 7: Test the Application User&#8217;s Database Access<\/strong><\/h3>\n\n\n\n<p>Check if the appuser can connect to their database and can execute operations:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>mysql -u appuser -p&#8217;AppUserStr0ngP@ss!&#8217; appdb<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1120\" height=\"132\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-19.png\" alt=\"mysql -u appuser -p 'AppUserStrongP@ass!' appdb\" class=\"wp-image-16672\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-19.png 1120w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-19-300x35.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-19-1024x121.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-19-768x91.png 768w\" sizes=\"(max-width: 1120px) 100vw, 1120px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Create a real application table.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>CREATE TABLE IF NOT EXISTS users (<\/p>\n<p>id INT AUTO_INCREMENT PRIMARY KEY,<\/p>\n<p>name VARCHAR(100) NOT NULL,<\/p>\n<p>email VARCHAR(150) UNIQUE NOT NULL,<\/p>\n<p>created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP<\/p>\n<p>);<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1125\" height=\"326\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-20.png\" alt=\"create table if not exists users\" class=\"wp-image-16673\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-20.png 1125w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-20-300x87.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-20-1024x297.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-20-768x223.png 768w\" sizes=\"(max-width: 1125px) 100vw, 1125px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Insert test records<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>INSERT INTO users (name, email) VALUES<\/p>\n<p>(&#8216;Alice Johnson&#8217;, &#8216;alice@example.com&#8217;),<\/p>\n<p>(&#8216;Bob Smith&#8217;, &#8216;bob@example.com&#8217;);<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1115\" height=\"261\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-21.png\" alt=\"insert into users (name, email)\" class=\"wp-image-16674\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-21.png 1115w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-21-300x70.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-21-1024x240.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-21-768x180.png 768w\" sizes=\"(max-width: 1115px) 100vw, 1115px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Query the data<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>SELECT * FROM users;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1127\" height=\"360\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-22.png\" alt=\"select * from users;\" class=\"wp-image-16675\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-22.png 1127w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-22-300x96.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-22-1024x327.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-22-768x245.png 768w\" sizes=\"(max-width: 1127px) 100vw, 1127px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Ensure that appuser is unable to access system databases: This will stop privilege escalation in the event of a compromise of the application:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>USE mysql;<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1135\" height=\"169\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-23.png\" alt=\"use mysql;\" class=\"wp-image-16676\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-23.png 1135w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-23-300x45.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-23-1024x152.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-23-768x114.png 768w\" sizes=\"(max-width: 1135px) 100vw, 1135px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The access denied error confirms that the privilege scoping is working correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a id=\"post-16653-_cfiaq4t7yky6\"><\/a><strong>Step 8: Configure the Firewall on AlmaLinux 10<\/strong><\/h3>\n\n\n\n<p>AlmaLinux 10 uses firewalld as its default firewall manager. Since MariaDB is bound to 127.0.0.1 and should never accept external connections in a standard <a href=\"https:\/\/greenwebpage.com\/community\/how-to-install-nginx-on-almalinux-10\/\">single-server setup<\/a>, verify that port 3306 is not publicly exposed:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo firewall-cmd &#8211;list-all<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1123\" height=\"512\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-24.png\" alt=\"sudo firewall-cmd --list-all\" class=\"wp-image-16677\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-24.png 1123w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-24-300x137.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-24-1024x467.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-24-768x350.png 768w\" sizes=\"(max-width: 1123px) 100vw, 1123px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>If port 3306 appears in the output, remove it immediately:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo firewall-cmd &#8211;permanent &#8211;remove-service=mysql<\/p>\n<p>sudo firewall-cmd &#8211;permanent &#8211;remove-port=3306\/tcp<\/p>\n<p>sudo firewall-cmd &#8211;reload<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1137\" height=\"323\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-25.png\" alt=\"sudo firewall-cmd --permanent --remove-service=mysql\" class=\"wp-image-16678\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-25.png 1137w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-25-300x85.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-25-1024x291.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-25-768x218.png 768w\" sizes=\"(max-width: 1137px) 100vw, 1137px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>If your architecture requires a remote database connection \u2014 for example, a web server on a private <a href=\"https:\/\/greenwebpage.com\/community\/how-to-configure-network-settings-on-almalinux-10\/\">network connecting<\/a> to a dedicated database server \u2014 open port 3306 only to the specific trusted IP address, never to the entire internet:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo firewall-cmd &#8211;permanent \\<\/p>\n<p>&#8211;add-rich-rule=&#8217;rule family=&#8221;ipv4&#8243; source address=&#8221;10.0.0.5\/32&#8243; port port=&#8221;3306&#8243; protocol=&#8221;tcp&#8221; accept&#8217;<\/p>\n<p>sudo firewall-cmd &#8211;reload<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1133\" height=\"263\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-26.png\" alt=\"sudo firewall-cmd --permanent \\\" class=\"wp-image-16679\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-26.png 1133w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-26-300x70.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-26-1024x238.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-26-768x178.png 768w\" sizes=\"(max-width: 1133px) 100vw, 1133px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Verify the rule was applied:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\n<p>sudo firewall-cmd &#8211;list-rich-rules<\/p>\n<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1131\" height=\"159\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-27.png\" alt=\"sudo firewall-cmd --list-rich-rules\" class=\"wp-image-16680\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-27.png 1131w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-27-300x42.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-27-1024x144.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/word-image-16653-27-768x108.png 768w\" sizes=\"(max-width: 1131px) 100vw, 1131px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-16653-_52uz5fs037o\"><\/a><strong>Troubleshooting Common Issues on AlmaLinux 10<\/strong><\/h2>\n\n\n\n<p>Using AlmaLinux 10, this guide covers common problems and how to fix them.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cannot connect as root after mysql_secure_installation.<\/strong> On AlmaLinux 10 and MariaDB 10.11, the root user logs in by default using Unix socket authentication. Use sudo mysql or mysql -u root -p from the \u201croot\u201d account of the OS. If you must log in as root, run: ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED VIA mysql_native_password USING PASSWORD(&#8216;yourpassword&#8217;);<\/li>\n\n\n\n<li><strong>MariaDB fails to start after editing the configuration file.<\/strong> Check the syntax of your configuration file before restarting it with mysqld &#8211;help &#8211;verbose 2>&amp;1 | head -20. If you find any syntax errors in the configuration file, MariaDB cannot start, and the syntax error is reported in \/var\/log\/mariadb\/mariadb.log.<\/li>\n\n\n\n<li><strong>Access denied for user &#8216;appuser.&#8217; <\/strong>This is because either the password is incorrect, or the user is attempting to log in from a host different from the one in the CREATE USER statement, or FLUSH PRIVILEGES was not executed after the grant statement. Check with: SELECT User, Host FROM mysql.user WHERE User=&#8217;appuser&#8217;;<\/li>\n\n\n\n<li><strong>Port 3306 appears in external network scans.<\/strong> This means that bind-address is not properly configured to 127.0.0.1, or that there is a rule in the firewalld configuration that allows port 3306. Check with sudo firewall-cmd &#8211;list-all and verify ss -tlnp | grep 3306 shows 127.0.0.1:3306, not 0.0.0.0:3306.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a id=\"post-16653-_5lsqglre3oft\"><\/a><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>On AlmaLinux 10, <a href=\"https:\/\/greenwebpage.com\/community\/how-to-install-mariadb-on-ubuntu-24-04\/\">install MariaDB<\/a> using dnf with the commands: sudo dnf install mariadb-server mariadb and then sudo systemctl enable &#8211;now mariadb to start it. Execute sudo mysql_secure_installation and follow the prompts to set a password for the root user, drop anonymous users, and disable remote access to root. You&#8217;ve done everything that was recommended to make MariaDB 10.11 as secure as possible, created the application user with the minimum privileges, hardened the configuration file, and ensured that only port 3306 is accessible on the firewall.<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>One of the most vulnerable resources is an unprotected, installed database server. Database attacks continue to be one of the three most recurring causes of enterprise data breaches year after year, and most of the attacks take advantage of misconfigurations that could have been avoided during initial setup in less than 30 minutes, according to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":16683,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[1024,675,601,250],"class_list":["post-16653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-almalinux-10","tag-database","tag-mariadb","tag-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide) - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"In this guide, you&#039;ll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide) - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"In this guide, you&#039;ll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-17T16:49:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-17T16:49:07+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide)\",\"datePublished\":\"2026-05-17T16:49:01+00:00\",\"dateModified\":\"2026-05-17T16:49:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\"},\"wordCount\":1606,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg\",\"keywords\":[\"AlmaLinux 10\",\"Database\",\"MariaDB\",\"MySQL\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\",\"name\":\"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide) - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg\",\"datePublished\":\"2026-05-17T16:49:01+00:00\",\"dateModified\":\"2026-05-17T16:49:07+00:00\",\"description\":\"In this guide, you'll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to install and Secure MySQLMariaDB on AlmaLinux 10 Step-by-step Guide\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide) - Greenwebpage Community","description":"In this guide, you'll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/","og_locale":"en_US","og_type":"article","og_title":"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide) - Greenwebpage Community","og_description":"In this guide, you'll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.","og_url":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/","og_site_name":"Greenwebpage Community","article_published_time":"2026-05-17T16:49:01+00:00","article_modified_time":"2026-05-17T16:49:07+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide)","datePublished":"2026-05-17T16:49:01+00:00","dateModified":"2026-05-17T16:49:07+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/"},"wordCount":1606,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg","keywords":["AlmaLinux 10","Database","MariaDB","MySQL"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/","url":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/","name":"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide) - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg","datePublished":"2026-05-17T16:49:01+00:00","dateModified":"2026-05-17T16:49:07+00:00","description":"In this guide, you'll install MariaDB on AlmaLinux 10, implement all critical security hardening tasks, and configure database users that are properly scoped.","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2026\/05\/How-to-install-and-Secure-MySQLMariaDB-on-AlmaLinux-10-Step-by-step-Guide.jpg","width":1020,"height":600,"caption":"How to install and Secure MySQLMariaDB on AlmaLinux 10 Step-by-step Guide"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-and-secure-mysql-mariadb-on-almalinux-10\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Install and Secure MySQL\/MariaDB on AlmaLinux 10 (Step-by-Step Guide)"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/16653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=16653"}],"version-history":[{"count":2,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/16653\/revisions"}],"predecessor-version":[{"id":16682,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/16653\/revisions\/16682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/16683"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=16653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=16653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=16653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}