Installing a database client on an RPM-based host enables remote administration and troubleshooting without running a local database daemon, which keeps the system lightweight while still supporting interactive queries, imports, and exports against a separate database server.
On CentOS, Red Hat, and Fedora, client tools arrive as packages that provide an interactive SQL shell plus the client libraries used to negotiate authentication and speak the MySQL protocol; on many MariaDB installs, the primary binary is mariadb with a compatible mysql symlink available on Unix-like systems.
Package names and repositories vary by distribution and vendor, and mixing Oracle MySQL community packages with distribution-provided MariaDB packages can trigger RPM conflicts or package replacement during routine upgrades when the Oracle MySQL Yum repository is enabled.
Steps to install MySQL or MariaDB client on CentOS, Red Hat, or Fedora:
- Open a terminal with sudo privileges.
On CentOS 7, replace dnf commands with yum equivalents.
- Apply available updates with a metadata refresh.
$ sudo dnf upgrade --refresh --assumeyes Rocky Linux 9 - BaseOS 6.1 MB/s | 9.1 MB 00:01 Rocky Linux 9 - AppStream 6.4 MB/s | 12 MB 00:01 Rocky Linux 9 - Extras 24 kB/s | 17 kB 00:00 Dependencies resolved. ##### snipped ##### Complete!
- Choose a single client family before installing packages.
Due to conflicting RPM packages, installing both MariaDB and MySQL packages on the same host can fail or replace packages (for example, mysql-community-client obsoletes mariadb on Rocky 9), so remove one family before switching to the other.
- Install the MariaDB client from distribution repositories.
$ sudo dnf install --assumeyes mariadb Last metadata expiration check: 0:00:18 ago on Thu Jan 1 05:57:03 2026. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mariadb aarch64 3:10.5.27-1.el9_5.0.2 appstream 1.6 M Installing dependencies: groff-base aarch64 1.22.4-10.el9.0.1 baseos 1.0 M libedit aarch64 3.1-38.20210216cvs.el9 baseos 101 k mariadb-common aarch64 3:10.5.27-1.el9_5.0.2 appstream 27 k ##### snipped ##### Complete!
The mariadb package installs the client tools, while mariadb-server installs the server daemon.
- Verify the MariaDB client is available.
$ mariadb --version mariadb Ver 15.1 Distrib 10.5.27-MariaDB, for Linux (aarch64) using EditLine wrapper
If mysql is required by scripts, the MariaDB client commonly provides a mysql symlink on Unix-like systems.
- Install the Oracle MySQL Yum repository release package for MySQL Community client packages.
$ sudo dnf install --assumeyes https://dev.mysql.com/get/mysql84-community-release-el9-2.noarch.rpm Last metadata expiration check: 0:00:32 ago on Thu Jan 1 05:57:03 2026. mysql84-community-release-el9-2.noarch.rpm 32 kB/s | 14 kB 00:00 Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mysql84-community-release noarch el9-2 @commandline 14 k ##### snipped ##### Complete!
Match the release RPM to the platform, such as mysql84-community-release-el8-2.noarch.rpm, mysql84-community-release-el7-2.noarch.rpm, mysql84-community-release-fc42-3.noarch.rpm, or mysql84-community-release-fc41-2.noarch.rpm.
The Oracle repository can upgrade and replace existing third-party MySQL packages during routine dnf upgrades, so enable it deliberately and track what repositories are allowed on the host.
- Install the MySQL Community client package from the enabled repository.
$ sudo dnf install --assumeyes mysql-community-client MySQL Connectors Community 29 kB/s | 98 kB 00:03 MySQL 8.4 LTS Community Server 413 kB/s | 1.5 MB 00:03 MySQL Tools 8.4 LTS Community 561 kB/s | 784 kB 00:01 Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mysql-community-client aarch64 8.4.7-1.el9 mysql-8.4-lts-community 3.1 M replacing mariadb.aarch64 3:10.5.27-1.el9_5.0.2 ##### snipped ##### Complete!The mysql-community-client package contains the MySQL client applications and tools.
- Verify the MySQL client is available.
$ mysql --version mysql Ver 8.4.7 for Linux on aarch64 (MySQL Community Server - GPL)
- Test connectivity to a remote database server with the installed client.
$ mysql --host db.example.com --user appuser --password Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 Server version: 8.4.7 MySQL Community Server - GPL ##### snipped ##### mysql> exit Bye
Avoid passing passwords directly on the command line, because arguments can be visible in process listings and shell history.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
