Installing MariaDB on Windows with WSL

Installing MariaDB on Windows with WSL is super easy. First, launch your WSL Ubuntu server. Then install MariaDB with:
Then to start the MariaDB server, just run:
Launch on Startup
However, in order to launch the mysql server on startup without having to write the sudo service mysql start every time, we need to do couple things.
First, run this command:
And when the file opens, scroll to bottom of the file and add this into the file in it's own line:
And finally, press ctrl + x to save the file and exit.
What this did is that whenever we now launch mysql server using the command sudo /sbin/service mysql start, we no longer need to type in the password every time.
Now, to start the mysql server whenever you login, use this command:
Which adds the mysql startup command in your .bashrc file.
Testing the Installation
To test the installation, just run:
Which should start the MySQL CLI (Command-Line Interface).
Exiting from the MySQL Command Line Interface
To exit from the MySQL Command Line Interface (CLI), just write:
Or press:
Installing mycli
There is also a great command line interface available for MariaDB called mycli that I recommend using during this course. This command line interface includes auto-completion and syntax highlighting.
To install mycli, just run:
And after the installation, just run this to launch into mycli:
And to exit from mycli run this: