Install

Installation

Windows

Option 1: MySQL Installer

  • Choose Developer Default or Server Only

  • Configuration:

    • Port: 3306

    • Set root password

    • Enable MySQL as Windows service

Option 2: XAMPP


Linux

Debian/Ubuntu:

CentOS/RHEL:


macOS

Using Homebrew:

Or:

  • Download the .dmg installer from MySQL website


Post-Installation

Secure MySQL setup:

Start/Stop MySQL:

Linux/macOS:

Windows:

Or: Use XAMPP Control Panel


Connecting to MySQL

CLI:


Remote Connections

Step 1: Allow external connections

Edit my.cnf or my.ini:

Step 2: Create remote user:


Port Configuration

  • Default Port: 3306

  • To change it:

Config file paths:

  • Linux/macOS: /etc/mysql/my.cnf

  • Windows: C:\xampp\mysql\bin\my.ini

Last updated