MariaDB Server is available for installation on macOS (formerly Mac OS X) via the Homebrew package manager.
MariaDB Server is available as a Homebrew "bottle", a pre-compiled package. This means you can install it without having to build from source yourself. This saves time.
After installing Homebrew, MariaDB Server can be installed with this command:
brew install mariadb
After installation, start MariaDB Server:
mysql.server start
To auto-start MariaDB Server, use Homebrew's services functionality, which configures auto-start with the launchctl utility from launchd:
brew services start mariadb
After MariaDB Server is started, you can log in:
mysql -u root
refer: https://mariadb.com/kb/en/library/installing-mariadb-on-macos-using-homebrew/