Subscribe

Mac installing MariaDB

✍️

Learn in this guide how to install MariaDB on a mac and how to start and stop the service.

5 Jan, 2021 · 2 min read

Yesterday we installed MySQL on our Mac. However, you might be thinking, what about MariaDB?

MariaDB has been known to be the next step. It’s highly compatible to migrate your MySQL to MariaDB.

Luckily for us, this installation process is more straightforward than MySQL since we can use Homebrew.

Install MariaDB on Mac with Homebrew

To install MariaDB, we need to have Homebrew installed first.

If you don’t have this installed, follow my guide on installing Homebrew.

Open up your favorite terminal and execute the following command first to make sure Homebrew is up to date:

brew update

Then we can install MariaDB with this command:

brew install MariaDB

This will start a series of cool lines in your terminal, making you look like a hackerman! Afterward, MariaDB should run on your Mac.

Hackerman gif

Once it is done, we have successfully installed MariaDB.

We can now start or stop the MariaDB service using Homebrew:

brew services start mariadb
brew services stop mariadb

Connecting to the MySQL server

Once you start the server you can run the following command to connect to the database:

mysql -uroot -p

It will ask for your password, and if correct, it will show the following:

MariaDB connection

We can also use a tool like TablePlus to connect to our MariaDB.

Add a new MariaDB connection using the following settings.

  • host: 127.0.0.1
  • user: root
  • password: You choose this in the installation
  • port: 3306 (default)

MariaDB TablePlus connection

Help, the password is wrong

I had the issue where my password didn’t work because of the running instance of MySQL. First of all, stop running MySQL instances using the Settings => MySQL interface.

Now you can run the following command:

sudo mysql_secure_installation

The sudo is important here to generate a new root password. In my case, I just made it the same as what I had.

Follow the steps it prompts. Everything can be answered with Yes.

Now you should be able to log in again.

Thank you for reading, and let’s connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Spread the knowledge with fellow developers on Twitter
Tweet this tip
Powered by Webmentions - Learn more

Read next 📖

Thank you, Apple, for hijacking port 5000 😣

3 Dec, 2021 · 2 min read

Thank you, Apple, for hijacking port 5000 😣

Streaming desktop sound and microphone on Mac with Streamlabs

25 Nov, 2021 · 2 min read

Streaming desktop sound and microphone on Mac with Streamlabs

Join 2097 devs and subscribe to my newsletter