This article will take you through how to install MariaDB 10.8 on OpenSUSE. MariaDB is a fork of the MySQL relational database management system (RDBMS) developed by the community and maintained commercially, with the goal of being free and open-source software under the GNU General Public License. MariaDB is run by several of the original MySQL developers, who forked the project in response to concerns about Oracle Corporation’s acquisition of MySQL.
How to Install MariaDB 10.8 on OpenSUSE
- Add MariaDB 10.8 repository to your system.
sudo zypper addrepo --gpgcheck --refresh https://yum.mariadb.org/10.8/sles/15/x86_64 mariaDB
Sample output
Adding repository 'mariaDB' ...........................................[done] Repository 'mariaDB' successfully added URI : https://yum.mariadb.org/10.8/sles/15/x86_64 Enabled : Yes GPG Check : Yes Autorefresh : Yes Priority : 99 (default priority) Repository priorities are without effect. All enabled repositories share the same priority.
- Refresh your repositories.
sudo zypper --gpg-auto-import-keys refresh
- Then install MariaDB.
sudo zypper install MariaDB-server MariaDB-client
Sample output
Loading repository data... Reading installed packages... Resolving package dependencies... The following recommended package was automatically selected: pmdk The following 9 NEW packages are going to be installed: galera-4 libboost_program_options1_66_0 libndctl6 libpmem1 MariaDB-client MariaDB-common MariaDB-server pmdk socat 9 new packages to install. Overall download size: 38.8 MiB. Already cached: 0 B. After the operation, additional 215.5 MiB will be used. Continue? [y/n/v/...? shows all options] (y): y Retrieving package MariaDB-common-10.8.3-1.x86_64 (1/9), 78.3 KiB (298.0 KiB unpacked) Retrieving: MariaDB-common-10.8.3-1.x86_64.rpm ...........[done (16.0 KiB/s)] Retrieving package libboost_program_options1_66_0-1.66.0-12.3.1.x86_64 (2/9), 139.9 KiB (500.6 KiB unpacked) Retrieving: libboost_program_options1_66_0-1.66.0-12.3.1.x86_64.rpm ...[done] Retrieving package libndctl6-71.1-150400.8.5.x86_64 (3/9), 116.0 KiB (253.9 KiB unpacked) Retrieving: libndctl6-71.1-150400.8.5.x86_64.rpm ..........[done (3.0 KiB/s)] Retrieving package pmdk-1.11.1-150400.1.10.x86_64 (4/9), 37.3 KiB ( 40.1 KiB unpacked) Retrieving: pmdk-1.11.1-150400.1.10.x86_64.rpm ............[done (3.0 KiB/s)] Retrieving package socat-1.7.3.2-4.10.x86_64 (5/9), 227.4 KiB (710.5 KiB unpacked) Retrieving: socat-1.7.3.2-4.10.x86_64.rpm ...............[done (250.8 KiB/s)] Retrieving package libpmem1-1.11.1-150400.1.10.x86_64 (6/9), 88.1 KiB (339.4 KiB unpacked) Retrieving: libpmem1-1.11.1-150400.1.10.x86_64.rpm ....................[done] Retrieving package galera-4-26.4.11-1.sle15.x86_64 (7/9), 15.4 MiB ( 15.4 MiB unpacked) Retrieving: galera-4-26.4.11-1.sle15.x86_64.rpm .........[done (203.4 KiB/s)] Retrieving package MariaDB-client-10.8.3-1.x86_64 (8/9), 7.4 MiB ( 76.7 MiB unpacked) Retrieving: MariaDB-client-10.8.3-1.x86_64.rpm ..........[done (261.9 KiB/s)] Retrieving package MariaDB-server-10.8.3-1.x86_64 (9/9), 15.3 MiB (121.3 MiB unpacked) Retrieving: MariaDB-server-10.8.3-1.x86_64.rpm ..........[done (179.2 KiB/s)] Checking for file conflicts: ..........................................[done] (1/9) Installing: MariaDB-common-10.8.3-1.x86_64 ......................[done] (2/9) Installing: libboost_program_options1_66_0-1.66.0-12.3.1.x86_64 .[done] (3/9) Installing: libndctl6-71.1-150400.8.5.x86_64 ....................[done] (4/9) Installing: pmdk-1.11.1-150400.1.10.x86_64 ......................[done] (5/9) Installing: socat-1.7.3.2-4.10.x86_64 ...........................[done] (6/9) Installing: libpmem1-1.11.1-150400.1.10.x86_64 ..................[done] (7/9) Installing: galera-4-26.4.11-1.sle15.x86_64 .....................[done] (8/9) Installing: MariaDB-client-10.8.3-1.x86_64 ......................[done] usermod: no changes (9/9) Installing: MariaDB-server-10.8.3-1.x86_64 ......................[done] Executing %posttrans scripts ..........................................[done]
- Enable MariaDB to start on boot and start it.
sudo systemctl enable --now mariadb
- MariaDB should be up and running, check its status.
systemctl status mariadb.service
Sample output
● mariadb.service - MariaDB 10.8.3 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Wed 2022-06-15 23:30:26 EAT; 1min 9s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 6631 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 6632 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, statu> Process: 6655 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Main PID: 6641 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 9 (limit: 4589) CGroup: /system.slice/mariadb.service └─6641 /usr/sbin/mariadbd
- Secure MariaDB by running the command below.
sudo mariadb-secure-installation
Sample output
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! 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 haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] n ... skipping. 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!
- Next, set your root password by running the command below.
sudo /usr/bin/mysqladmin -u root password 'Your-Password'
- Login to MariaDB using the command below.
mysql -u root -p
Sample output
Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 24 Server version: 10.8.3-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> SELECT VERSION(); +----------------+ | VERSION() | +----------------+ | 10.8.3-MariaDB | +----------------+ 1 row in set (0.001 sec) MariaDB [(none)]>
- That marks the end of our article, congratulations. We have gone through how to install MariaDB 10.8 on OpenSUSE.
Read more on MariaDB Documentation
Other Tutorials
Install MariaDB 10.7 on CentOS 7