FastAPI - Beginner to Pro / Large Production Database Setup

MySQL Installation (Mac)

🐬 MySQL Installation Guide (macOS)

macOS • MySQL Community Edition


1. Download MySQL

  1. Go to: https://dev.mysql.com/downloads/mysql/

  2. Select your macOS version

  3. Download:

    • macOS (.dmg) installer

  4. Click “No thanks, just start my download”

  5. Save the file


2. Install MySQL

  1. Open the downloaded .dmg file

  2. Double-click the MySQL installer package (.pkg)

  3. Click Continue → Agree → Install

  4. Enter your Mac password if prompted


3. Configure MySQL

During installation:

  • Choose Use Strong Password Encryption

  • Set a root password (remember this!)

👉 Password tips:

  • At least 8 characters

  • Use letters, numbers, symbols


4. Complete Installation

After installation, you’ll see a success screen.

✔ MySQL Server is now installed

✔ It usually starts automatically


5. Install MySQL Workbench (GUI)

👉 Unlike Windows FULL setup, Workbench is NOT included by default

  1. Go to: https://dev.mysql.com/downloads/workbench/

  2. Download the macOS version

  3. Install like a normal app


6. Verify Installation

Using Terminal:

mysql -u root -p

Enter password → You should see:

mysql>

Run:

SHOW DATABASES;

Using Workbench:

  • Open MySQL Workbench

Click on Local Instance

  • Create connection:

    • Host: localhost

    • Port: 3306

    • User: root

  • Enter password


7. Start / Stop MySQL

Using System Preferences:

  • Open System Settings

  • Find MySQL

  • Start / Stop server

Using Terminal:

sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop

8. Add MySQL to PATH (Recommended)

Edit your shell config:

For zsh (default):

nano ~/.zshrc

Add:

export PATH="/usr/local/mysql/bin:$PATH"

Save and run:

source ~/.zshrc

Test:

mysql --version