How to Install MariaDB on Fedora 44

Install MariaDB on Fedora 44 with DNF. Covers service startup, hardening, localhost binding, first database login, and cleanup steps.

Last updatedAuthorJoshua JamesRead time8 minGuide typeFedora

Fedora 44 uses MariaDB 11.8 as the unversioned repository default, so the package name decides whether a server gets the current Fedora branch or the older 10.11 LTS branch. To install MariaDB on Fedora without adding a third-party repo, use mariadb-server for the default 11.8 path or mariadb10.11-server only when an application has not been cleared for 11.x.

Both server packages install a matching client and Fedora’s mysql-selinux policy package. After installation, enable mariadb.service, verify the socket and listener, create a dedicated application login, keep the database bound to localhost unless remote clients truly need it, and remove the package set cleanly if the host changes roles.

Install MariaDB on Fedora

Fedora 44 keeps MariaDB 11.8 and 10.11 in the standard DNF repositories. They are mutually exclusive because both provide mariadb-server-any and use the same data directory, service unit, and TCP port.

PackageBranchCommunity MaintenanceUse When
mariadb-server11.8.x LTS (Fedora 44 default)Through 4 Jun 2028You want Fedora’s current default branch for a new database host.
mariadb10.11-server10.11.x LTSThrough 16 Feb 2028An application or migration plan has not been tested with MariaDB 11.x yet.

Use the default 11.8 path for new Fedora 44 installs. Choose 10.11 only for compatibility with an application, restore plan, or migration window that still expects that branch. Do not add MariaDB’s upstream repository for this workflow; Fedora’s own packages supply the server, client, systemd unit, SELinux policy, updates, and removal path used here.

Update Fedora before installing MariaDB

Refresh package metadata first so DNF sees the current MariaDB build and any pending Fedora security updates.

sudo dnf upgrade --refresh -y

These commands use sudo for tasks that need root privileges. If your account is not in the sudoers file yet, follow the guide to add a user to sudoers on Fedora first.

Reboot before continuing if the upgrade pulled in a new kernel and you want the database service to start against the fully updated system.

Install MariaDB 11.8 (default) on Fedora

Install the default server package from Fedora’s repositories. On Fedora 44, this resolves to MariaDB 11.8 and is the only package you need on a host that will both run MariaDB and administer it locally.

sudo dnf install -y mariadb-server

The mariadb-server package also pulls in the mariadb client and Fedora’s mysql-selinux policy package, so you do not need a separate client install on the same host.

Do not install only mariadb when this Fedora machine needs to run the database service. That package installs the client stack, while mariadb-server installs the local server, service unit, and client together.

rpm -q mariadb-server mariadb mysql-selinux
mariadb-server-11.8.6-2.fc44.x86_64
mariadb-11.8.6-2.fc44.x86_64
mysql-selinux-1.0.14-3.fc44.noarch

Install MariaDB 10.11 (versioned LTS) on Fedora

Use the versioned 10.11 package only when a workload still needs that LTS branch. It uses the same mariadb.service unit, data directory, and port as the default package, so install only one branch on a host.

sudo dnf install -y mariadb10.11-server

The mariadb10.11-server package pulls in the matching mariadb10.11 client and the same mysql-selinux policy. The service unit, data directory, and port are identical to the default 11.8 path.

rpm -q mariadb10.11-server mariadb10.11 mysql-selinux
mariadb10.11-server-10.11.16-2.fc44.x86_64
mariadb10.11-10.11.16-2.fc44.x86_64
mysql-selinux-1.0.14-3.fc44.noarch

Enable and start MariaDB on Fedora

Fedora installs MariaDB without starting it, so enable the service explicitly on the first run.

sudo systemctl enable --now mariadb

The service unit initializes the data directory during the first startup, so the normal DNF workflow does not need a separate mariadb-install-db step.

systemctl is-enabled mariadb && systemctl is-active mariadb
enabled
active

Check the MariaDB version on Fedora

Confirm which MariaDB branch Fedora installed before you start creating databases or comparing package behavior with other distributions.

mariadb --version

MariaDB 11.8 reports:

mariadb from 11.8.6-MariaDB, client 15.2 for Linux (x86_64) using  EditLine wrapper

MariaDB 10.11 reports:

mariadb  Ver 15.1 Distrib 10.11.16-MariaDB, for Linux (x86_64) using  EditLine wrapper

Check the MariaDB socket path on Fedora

Some frameworks ask for a Unix socket path instead of a TCP host and port. Fedora’s packaged service initializes the default MariaDB socket under /var/lib/mysql/mysql.sock for both branches.

sudo mariadb -NBe "SHOW VARIABLES LIKE 'socket';"
socket	/var/lib/mysql/mysql.sock

Get Started with MariaDB on Fedora

Once the service is running, switch from the root account to a dedicated database login as quickly as possible. That keeps web applications and scripts off the MariaDB administrative account.

Open the MariaDB shell on Fedora

Use the MariaDB-native client name for the first administrative login. Fedora also installs the legacy mysql alias, but mariadb makes the server family clearer in scripts and matches the normal sudo mariadb admin workflow.

sudo mariadb

Leave the shell with exit or \q when you are done.

Create a database and application user on Fedora

Create a dedicated database and login for the application that will use MariaDB. Replace myappdb, myappuser, and the sample password with values that fit your workload.

CREATE DATABASE myappdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'myappuser'@'localhost' IDENTIFIED BY 'ChangeMe123!';
GRANT ALL PRIVILEGES ON myappdb.* TO 'myappuser'@'localhost';
FLUSH PRIVILEGES;

The temporary MYSQL_PWD variable below lets you test the new login once without writing the password into a config file. Replace the sample password before you run it.

MYSQL_PWD="ChangeMe123!" mariadb -h 127.0.0.1 -u myappuser -D myappdb -e "SELECT DATABASE(), CURRENT_USER();"
DATABASE()      CURRENT_USER()
myappdb         myappuser@localhost

If this Fedora host is heading toward a full web stack, continue with install Nginx on Fedora and install PHP on Fedora, then configure Nginx for PHP-FPM on Fedora once the database login is working.

Secure MariaDB on Fedora

Fedora’s MariaDB package already skips some classic insecure defaults, but it still needs an explicit hardening pass. On Fedora 44, a new MariaDB install already omitted anonymous users and the test database, yet the service listened on IPv4 and IPv6 wildcard addresses until a bind address was set.

If the database and the application share the same Fedora host, keep MariaDB on localhost and skip remote access entirely. Opening port 3306 to other machines should be the exception, not the baseline.

Run the MariaDB hardening command on Fedora

Run MariaDB’s interactive hardening script once after the service starts. On a fresh install, press Enter when it asks for the current root password.

sudo mariadb-secure-installation

Relevant prompts include:

Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n]
Change the root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]

Choose explicit MariaDB hardening answers on Fedora

  • Current root password: Press Enter on a fresh Fedora install.
  • Switch to unix_socket authentication: Answer Y for most single-host servers so local administration stays tied to sudo mariadb instead of a shared root password.
  • Change the root password: Answer Y only if you deliberately need a password-based root login in addition to local socket access.
  • Remove anonymous users: Answer Y. Fedora 44 already omits anonymous users on a new install, but the cleanup is still safe to confirm.
  • Disallow root login remotely: Answer Y.
  • Remove the test database: Answer Y. Fedora 44 already omits it on a new install, but the prompt is still worth clearing.
  • Reload privilege tables now: Answer Y so every change takes effect immediately.

The unix_socket prompt can look a little contradictory on Fedora because MariaDB already treats the root account as protected before you finish the script. In practice, a plain mariadb -u root login still fails for unprivileged users, while sudo mariadb remains the clean local admin path. This applies equally to both the 10.11 and 11.8 branches.

The official mariadb-secure-installation documentation covers the full prompt set, but these answers are the safest baseline for a normal Fedora application host.

Keep MariaDB local-only on Fedora

If MariaDB only serves applications on the same Fedora machine, add a small drop-in that binds the server to 127.0.0.1 instead of editing Fedora’s packaged config file in place.

printf '%s\n' '[mysqld]' 'bind-address=127.0.0.1' | sudo tee /etc/my.cnf.d/99-mariadb-local-only.cnf > /dev/null

The tee command writes the new drop-in as root because plain shell redirection does not inherit sudo. Keeping the setting in /etc/my.cnf.d/ also makes it easier to undo later.

sudo systemctl restart mariadb
ss -ltn | grep 3306
LISTEN 0      80         127.0.0.1:3306      0.0.0.0:*

The second command filters the socket list with grep command in Linux with examples, so you only see MariaDB’s 3306 listener.

If another host truly needs MariaDB, replace 127.0.0.1 with the server’s LAN address or 0.0.0.0, then allow only the narrow firewall rule you actually need. Fedora ships a mysql firewalld service definition, so start with the guide to install firewalld on Fedora before you expose port 3306.

Troubleshoot MariaDB on Fedora

These are the Fedora-specific problems most likely to cause confusion on a fresh MariaDB install.

MariaDB root login fails without sudo on Fedora

Fedora’s default root account definition is meant for local administrative access, not for an unprivileged shell using mariadb -u root directly.

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

A password-based root attempt can show a similar access denied error. Open an administrative shell with sudo mariadb, then create or reset a dedicated application user instead of using the MariaDB root account from an app.

Use the system root account for the first admin session, then keep day-to-day application access on dedicated database users instead of the MariaDB root account.

sudo mariadb -e "SELECT 1;"
1
1

MariaDB user gets using password: YES on Fedora

If an app or test login returns this error, MariaDB accepted the connection path but rejected the credentials for that user and host. Check that the app uses the dedicated account created earlier, not the MariaDB root account, then reset only that app user’s password if needed.

ERROR 1045 (28000): Access denied for user 'myappuser'@'localhost' (using password: YES)
sudo mariadb -e "ALTER USER 'myappuser'@'localhost' IDENTIFIED BY 'NewStrongPassword!'; FLUSH PRIVILEGES;"
MYSQL_PWD="NewStrongPassword!" mariadb -h 127.0.0.1 -u myappuser -D myappdb -e "SELECT CURRENT_USER();"
CURRENT_USER()
myappuser@localhost

A web app still cannot reach MariaDB over TCP on Fedora

If an Apache or Nginx application connects to MariaDB over TCP instead of the local socket, Fedora’s SELinux policy can block the request even when the credentials and bind address are correct.

getsebool httpd_can_network_connect_db
sudo setsebool -P httpd_can_network_connect_db 1
getsebool httpd_can_network_connect_db
httpd_can_network_connect_db --> off
httpd_can_network_connect_db --> on

If the web app and MariaDB share the same Fedora host, using the local MariaDB socket instead of TCP can avoid this SELinux toggle and keeps database traffic off the network stack.

Remove MariaDB from Fedora

Remove the packages first, then decide whether the database files and any local hardening drop-ins should stay for backup or troubleshooting.

Stop the service and remove MariaDB packages on Fedora

Disable the service before removal so it does not try to start again during future boots. Use the remove command that matches whichever branch you installed.

sudo systemctl disable --now mariadb

For MariaDB 11.8 (Fedora 44 default):

sudo dnf remove -y mariadb-server mariadb

For MariaDB 10.11:

sudo dnf remove -y mariadb10.11-server mariadb10.11

DNF also removes the weak dependencies that came in with the server package, including mysql-selinux, so you do not need a separate dependency cleanup step.

Delete MariaDB data, logs, and local drop-ins on Fedora

Only do this when you are certain the host should not keep any local MariaDB state for backup, rollback, or future reuse.

Only remove the MariaDB data directory after you have confirmed your backups. Deleting /var/lib/mysql permanently removes the local databases stored on this Fedora host.

Fedora removes the packaged /etc/my.cnf.d/mariadb-server.cnf file with the package itself, but it leaves your data directory, log directory, and any local drop-ins you created. Remove them manually only if you are truly retiring MariaDB from this machine.

sudo rm -rf /var/lib/mysql /var/log/mariadb /etc/my.cnf.d/99-mariadb-local-only.cnf

Verify MariaDB removal on Fedora

Check that the server, client, and SELinux package are all gone before you treat the removal as complete. This combined check covers both Fedora package branches documented above.

rpm -q mariadb-server mariadb mariadb10.11-server mariadb10.11 mysql-selinux
package mariadb-server is not installed
package mariadb is not installed
package mariadb10.11-server is not installed
package mariadb10.11 is not installed
package mysql-selinux is not installed

Conclusion

MariaDB is running on Fedora with the 11.8 default branch or the 10.11 versioned LTS branch, a dedicated application login, and a local-only hardening option ready for normal single-host stacks. If this host is becoming a web server, continue with install Nginx on Fedora, install PHP on Fedora, and install firewalld on Fedora before exposing the database beyond localhost.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show our tutorials more often in Top Stories and mark them as preferred in AI Mode and AI Overviews when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<a href="https://example.com">link</a> link
<blockquote>quote</blockquote> quote block

Add to the discussion

Questions, fixes, command output, and version notes help keep this guide current.

Verify before posting: