Install MySQL / MariaDB on Windows Subsystem for Linux (Ubuntu 18.04)

Windows Subsystem for Linux (WSL) let’s you do a lot of interesting stuff inside Windows, biggest of which is installing Linux applications. We’ll look into installing MariaDB on Ubuntu running inside WSL.

Before we start, make sure you have WSL activated and Ubuntu installed, follow this link if you haven’t done so.

Start off by adding repositories required by MariaDB

sudo apt-get install software-properties-common

sudo apt-key adv --recv-keys --keyserver hkp:// 0xF1656F24C74CD1D8

sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] bionic main'

Update your installation

sudo apt update

Install MariaDB

sudo apt install mariadb-server

You’ll be prompted to set a root password and wait for the installation to continue. Issue the following command once installation is complete:

sudo service mysql start

That’s it.