Menu

Install MariaDB on openSUSE with zypper

Install MariaDB Server on openSUSE with zypper, start its systemd service, secure the local instance, and create a database and user.

Posted on By Updated on
On this page

On openSUSE, install MariaDB with the zypper package manager. This guide uses MariaDB’s RPM repository so you can choose a MariaDB release supported for your openSUSE version. Repository URLs vary by distribution release and CPU architecture, so use the official repository configuration tool to generate the matching commands.

Check your openSUSE release

Confirm the distribution and architecture before selecting a repository:

cat /etc/os-release
uname -m

Open the MariaDB Repository Configuration Tool, select the openSUSE release and architecture it lists for your system, and choose the MariaDB series you plan to install. Follow its generated repository instructions. MariaDB’s zypper installation guide recommends using the MariaDB RPM repository with zypper and documents the server and client package names.

If your openSUSE release is not listed by the repository tool, use a repository supported by that release. Do not reuse a repository URL generated for a different openSUSE or SUSE Linux Enterprise version.

Install the server and client

Refresh the package metadata, then install MariaDB Server and its command-line client:

sudo zypper refresh
sudo zypper install MariaDB-server MariaDB-client

Review the package changes shown by zypper and confirm the installation. To inspect available server versions first, run:

zypper search --details MariaDB-server

Start MariaDB and enable it at boot

MariaDB packages include a systemd unit on openSUSE. Start the service now and configure it to start automatically after a reboot:

sudo systemctl enable --now mariadb.service
sudo systemctl status mariadb.service --no-pager

The MariaDB systemd guide documents the mariadb.service unit for openSUSE and the systemctl commands used to manage it.

If the service does not start, inspect its recent logs:

sudo journalctl -u mariadb.service -e --no-pager

Secure the local installation

Run MariaDB’s setup script and read each prompt before accepting changes:

sudo mariadb-secure-installation

The script can remove anonymous accounts, disable remote root access, and remove the test database. MariaDB 10.4 and later commonly use Unix socket authentication for the local root account, so a root password may not be necessary. See the official script documentation for details.

Open a local administrative session:

sudo mariadb

Confirm the installed version:

SELECT VERSION();

Create an application database and user

Inside the MariaDB prompt, create a database and a local-only runtime account with row-level privileges. Replace the example password with a unique secret; use a separate account for schema migrations:

CREATE DATABASE appdb;
CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'replace-with-a-strong-password';
GRANT SELECT, INSERT, UPDATE, DELETE ON appdb.* TO 'appuser'@'localhost';

Exit the administrative session and test the application account:

EXIT;
mariadb -u appuser -p appdb

Keep the database bound to local access unless a remote client must connect. For remote access, configure authentication, network rules, and firewall access for the intended hosts rather than exposing the server broadly.