{"id":3540,"date":"2019-07-06T13:46:42","date_gmt":"2019-07-06T10:46:42","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3540"},"modified":"2019-09-10T16:46:38","modified_gmt":"2019-09-10T13:46:38","slug":"install-mariadb-10-4-on-ubuntu-18-04-debian-9","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mariadb-10-4-on-ubuntu-18-04-debian-9\/","title":{"rendered":"Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9"},"content":{"rendered":"\n

This guide demonstrates how to install MariaDB 10.4 on Ubuntu 18.04\/Debian 9. MariaDB 10.4.6<\/a> is the latest stable release as of this writing.<\/p>\n\n\n\n

MariaDB 10.4 has come with a whole lot changes and improvements<\/a>.<\/p>\n\n\n\n

Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9<\/h2>\n\n\n\n

To install MariaDB 10.4, we are going to use MariaDB APT repo. This repo is not available by default on Ubuntu 18.04 systems. Hence, you need to create it.<\/p>\n\n\n\n

Update and upgrade your system packages.<\/p>\n\n\n\n

apt update\napt upgrade<\/code><\/pre>\n\n\n\n

Create MariaDB APT Repo<\/h3>\n\n\n\n

To create MariaDB APT repo, you can use the add-apt-repository<\/strong> command. However, this command is not available by default and ence, you need to first install the software-properties-common<\/strong>.<\/p>\n\n\n\n

apt install software-properties-common<\/code><\/pre>\n\n\n\n

Import MariaDB APT Repo GPG Signing Key<\/h3>\n\n\n\n

Note that on Debian 9, you need to install the dirmngr<\/strong> package before you can import the GPG public key. dirmngr is used for managing and downloading OpenPGP and X.509 certificates.<\/p>\n\n\n\n

apt install dirmngr<\/code><\/pre>\n\n\n\n

Next, run the command below to import MariaDB APT repo GPG signing key.<\/p>\n\n\n\n

sudo apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xF1656F24C74CD1D8<\/code><\/pre>\n\n\n\n

On Ubuntu 18.04, you can now create MariaDB 10.4 repo as shown below.<\/p>\n\n\n\n

sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http:\/\/sfo1.mirrors.digitalocean.com\/mariadb\/repo\/10.4\/ubuntu bionic main'<\/code><\/pre>\n\n\n\n

On Debian 9, you can create MariaDB 10.4 repo by running the command below;<\/p>\n\n\n\n

sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http:\/\/mirror.zol.co.zw\/mariadb\/repo\/10.4\/debian stretch main'<\/code><\/pre>\n\n\n\n

Run System Update<\/h3>\n\n\n\n

Before you can install MariaDB 10.4, update the system package cache by executing the following command:<\/p>\n\n\n\n

apt update\napt upgrade<\/code><\/pre>\n\n\n\n

Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9<\/h3>\n\n\n\n

To install MariaDB 10.4 server and client, run the command below;<\/p>\n\n\n\n

apt install mariadb-server mariadb-client<\/code><\/pre>\n\n\n\n

Running MariaDB 10.4<\/h3>\n\n\n\n

After installation, MariaDB started by default. It is also set to run on system boot by default.<\/p>\n\n\n\n

systemctl status mariadb.service\n\u25cf mariadb.service - MariaDB 10.4.6 database server\n   Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\n  Drop-In: \/etc\/systemd\/system\/mariadb.service.d\n           \u2514\u2500migrated-from-my.cnf-settings.conf\n   Active: active (running) since Sat 2019-07-06 11:41:39 EAT; 41s ago\n     Docs: man:mysqld(8)\n           https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n Main PID: 11660 (mysqld)\n   Status: \"Taking your SQL requests now...\"\n    Tasks: 32 (limit: 2340)\n   CGroup: \/system.slice\/mariadb.service\n           \u2514\u250011660 \/usr\/sbin\/mysqld<\/code><\/pre>\n\n\n\n
systemctl is-enabled mariadb.service\nenabled<\/code><\/pre>\n\n\n\n

MariaDB 10.4 Authentication<\/h2>\n\n\n\n

MariaDB 10.4 comes with a lot of security changes with the root@localhost<\/strong> user account being secured by default. The fact that you were supposed to set and remember the password of MariaDB server root user password no longer exists.<\/p>\n\n\n\n

The root@localhost<\/code> user created with the ability to either use;<\/p>\n\n\n\n