MariaDB Macbook Installation Guide

Open Terminal

  • Go to Finder and type “Terminal”

Install Homebrew (Based from https://brew.sh/)

  • Copy the command at the site

     /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

  • Paste to the command line in the terminal and press enter
  • Enter your Macbook Password and press enter
  • Wait to be installed

Install Maria DB (Based from https://mariadb.com/kb/en/installing-mariadb-on-macos-using-homebrew/)

  • Copy and Paste to the command line in the terminal, press enter every command

brew install MariaDB

mysql.server start

brew services start MariaDB

mysql

  • Create database in the command line

-> CREATE DATABASE ‘yourDB’; -> without the ”

  • Check if your database has been created

—> SHOW DATABASES;

  • Create User and password

—> CREATE USER ‘yourname’@localhost IDENTIFIED by ‘password123’;

Note : ‘yourname’ is the username and @localhost will be the server which is in your computer.

  • Check if the user has been created

—> SELECT User FROM mysql.user;

  • Give your user access to your new database

—> GRANT ALL PRIVILIGES ON . TO ‘yourname’@localhost IDENTIFIED by ‘password123’;

Note :  “.” means giving access to your user to ALL EXISTING DATABASE

  • Check what ACCESS the user have

—> SHOW GRANTS For ‘yourname’@localhost

Install TablePlus (Because HeidiSQL does not work on Mac)

  • Go to tableplus.com

  • Click “Download for Mac and Install As is

  • Connect your MariaDB to TablePlus by
    • Clicking the Plus Sign and Select MariaDB

  • Fill out the details below

    • Name – (Connection Name, put anything)

    • User – yourname (The username your created, before @localhost)

    • Password – password123 (Password you set after the “IDENTIFIED BY”)

    • Database – yourDB (Database name you created)

    • HOST – Make sure it is 127.0.0.1 that means it is localhost

  • Connect

  • Add Tables

    • Once you connected the TablePlus to your MariaDB, there is a Plus Sign at the lower right corner

Note : You can also Create Table using Command Line, check https://www.w3schools.com/sql/sql_create_table.asp for syntax

Leave a Reply

Your email address will not be published. Required fields are marked *