How To Install MariaDB 10.5 on openSUSE 15

Posted on 327 views

Are you looking for a complete guide on how to install MariaDB 1053 on openSUSE 15?. MariaDB is a drop-in replacement for MySQL. It is a robust, resilient, scalable and reliable RDBMS with features previously only available in costly proprietary databases.

The latest stable release as of this writing is MariaDB 10.5. This version is available from MariaDB maintained repositories for Ubuntu/Debian/CentOS/Fedora/SUSE. Install MariaDB 10.5 on openSUSE 15 now and enjoy its breadth of features.

Step 1: Add MariaDB ZYpp repository

MariaDB Corporation provides a MariaDB Package Repository for several Linux distributions that use zypper to manage packages. Add ZYpp repository for MariaDB by running the following commands.

Fetch repository GPG key.

sudo rpm --import
sudo zypper --gpg-auto-import-keys refresh

Then add the repository:

sudo zypper addrepo --gpgcheck --refresh mariadb

Execution output:

Adding repository 'mariadb' ..............................................[done]
Repository 'mariadb' successfully added

URI         :
Enabled     : Yes                                        
GPG Check   : Yes                                        
Autorefresh : Yes                                        
Priority    : 99 (default priority)                      

Repository priorities are without effect. All enabled repositories share the same priority.

Step 2: Install MariaDB 10.5 on openSUSE 15

After the zypper repository is configured, you can install MariaDB packages using zypper. The added repository contains software packages related to MariaDB Server, including the server itself, clients and utilitiesclient librariesplugins, and Mariabackup

To install MariaDB Server and client with ZYpp, run:

sudo zypper install MariaDB-server MariaDB-client

When prompted, press “y” to agree to installation.


Step 3: Start mariadb service

After the installation, start MariaDB service and set it to start at boot.

sudo systemctl enable --now mariadb

Confirm the service is running.

$ systemctl status mariadb.service 
● mariadb.service - MariaDB 10.5.15 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor pre>
  Drop-In: /etc/systemd/system/mariadb.service.d
   Active: active (running) since Thu 2019-05-30 03:20:05 EDT; 13s ago
     Docs: man:mysqld(8)
  Process: 3517 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_STA>
  Process: 3476 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VA>
  Process: 3475 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_STAR>
 Main PID: 3486 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 19660)
   CGroup: /system.slice/mariadb.service
           └─3486 /usr/sbin/mysqld

To Install the most common packages, execute the following command:

sudo zypper install galera MariaDB-shared MariaDB-backup MariaDB-common

Step 4: Secure MariaDB installation

If you’re running your server in production, it is recommended to run security script to set password for root user, remove test database and disable remote login for root user.


Secure your database by running the following script.

$ sudo mysql_secure_installation 


In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Ensure you:

  • Set Database root user password
  • Remove anonymous users
  • Disallow root user remote logins
  • Remove test database and access to it

For just setting root password, the following command syntax should work for new installation.

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h linux-bswe password 'new-password'

When done, test access using the root user – without a password.

$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

As seen, you need to authenticate to access database console as a root user.


Confirm MariaDB version.

MariaDB [(none)]> SELECT VERSION();
| VERSION()       |
| 10.5.15-MariaDB |
1 row in set (0.000 sec)

MariaDB [(none)]> 

You now have MariaDB 10.5 installed on openSUSE 15. Start working on your projects powered by MariaDB RDMS.


Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.