Installing MariaDB on Mac

First, you need to install Homebrew package manager for Mac. To do so, just run this on your terminal and follow the installation instructions:
Now, after installing Homebrew or Brew, you'll have the ability to install packages from Homebrew package repository, like you can with Ubuntu Linux.
First, before you can install software, you'll need to obtain the latest versions of software. To do so, run this first:
Then, to install MariaDB, just run:
And then start the server with:
Now we only need to do one more thing. Now when you restart your computer, you need to start the server again. We can use this command to start the MySQL server automatically each time your computer restarts:
Problems Installing?
If you are having problems installing mariadb using the commands above, try to run this command:
Setting root password
By default the Homebrew installation of MariaDB might not include the root password set for root user that we will require to connect from external tools. We can set this by executing this command:
This sets the password root for the user root.
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:
OR if that does not work, try:
And after the installation, just run this to launch into mycli:
And to exit from mycli run this: