First you’ll need to install Homebrew if you don’t have it on your machine :
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
If you already have homebrew installed, type brew update
Then : brew install mariadb
It will download and install some dependencies first (cmake, pidof, …) then it will download and build MariaDB on your mac.
It took around 7 minutes on my pc, so … go take a coffee
If this step finished successfully, congrats ! You have MariaDB running on your mac !
If not, type brew doctor and try to resolve all the problems before installing any package.
Now, type mysql to login. You’ll see something similar to this :
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.5.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
Type status, you should see a message similar to this one :
mysql Ver 15.1 Distrib 5.5.32-MariaDB, for osx10.6 (i386) using readline 5.1
You can now create new users, grant to them some privileges and start working.
If you’re running MariaDB on a production environment, type mysql_secure_installation and follow the instructions.