Yesterday we installed MySQL on our Mac, however, you might be wondering but 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 easier than MySQL since we can use Homebrew.
Installing MariaDB on Mac
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 go ahead and install MariaDB.
brew install MariaDB
This will start a whole series of cool lines in your Terminal which makes you look like hackerman!
Once it is done, we have successfully installed MariaDB.
We can now start/stop the service using Homebrew.
brew services start mariadb
brew services stop mariadb
Connecting to the MySQL server
Once you started the server you can run the following command to connect to our database.
mysql -uroot -p
It will ask for your password, and if correct it will show the following.
Now 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.1user
: rootpassword
: You choose this in the installationport
: 3306 (default)
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 the running MySQL instance 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