Skip to content

Instantly share code, notes, and snippets.

@ercansormaz
Created October 26, 2025 12:55
Show Gist options
  • Select an option

  • Save ercansormaz/51f8478c2d6840494ed56241780c9ff3 to your computer and use it in GitHub Desktop.

Select an option

Save ercansormaz/51f8478c2d6840494ed56241780c9ff3 to your computer and use it in GitHub Desktop.
MySQL Installation on macOS (Homebrew)

πŸ‘‰ Read the Blog Post

# Step 1: Install MySQL
brew install mysql

# Step 2: Start MySQL temporarily
brew services run mysql

# Step 3: Run secure installation
# For ARM64 (Apple Silicon)
/opt/homebrew/opt/mysql/bin/mysql_secure_installation

# For Intel
/usr/local/opt/mysql/bin/mysql_secure_installation

# During setup:
# - Skip VALIDATE PASSWORD COMPONENT
# - Set root password
# - Remove anonymous users β†’ Yes
# - Disallow root login remotely β†’ Yes
# - Remove test database β†’ Yes
# - Reload privilege tables β†’ Yes

# Step 4: Stop MySQL when done
brew services stop mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment