Skip to main content

Installation

When starting with MySQL, you have two main options for installation:

  1. Local Setup → Install MySQL on your personal computer/server.
  2. Cloud-Based Solutions → Use MySQL as a managed service from cloud providers.

Both have their own use cases, so let’s explore them.

Local Setup

  • Download MySQL Installer

    • Visit MySQL official downloads.
    • Choose version: Community Edition (free, open source).
  • Install MySQL Server

    • Run the installer.
    • Select "MySQL Server" and optionally tools like:
      • MySQL Workbench (GUI for database design/queries).
      • MySQL Shell (advanced CLI).
  • Configure Server

    • Choose:
      • Port (default: 3306).
      • Authentication (strong password for root user).
      • Data directory (where your DB files will be stored).
  • Verify Installation

    • Open terminal/command prompt and type:

      mysql -u root -p
    • Enter your password → You’re inside the MySQL shell.

Cloud Solutions

Running MySQL on cloud platforms allows you to offload infrastructure management (hardware, networking, patching, backups) while focusing on database usage, scaling, and replication.

Using MySQL on Amazon RDS

  1. Create RDS Instance

    • Go to AWS Console → RDS → Create database.
    • Select MySQL as the engine.
    • Choose free tier (for practice).
    • Set username (admin) and password.
  2. Get Connection Endpoint

    • AWS gives you a host URL like:

      mydb-instance.abcd1234.us-east-1.rds.amazonaws.com
  3. Connect to Cloud MySQL

    From local machine:

    mysql -h mydb-instance.abcd1234.us-east-1.rds.amazonaws.com -u admin -p

    Enter password → You are now connected to the cloud DB.

  4. Run SQL Queries

Local vs Cloud Setup

FeatureLocal SetupCloud Setup
InstallationManual (installer, config)Ready-to-use (just create instance)
CostFree (Community Edition)Pay-as-you-go (some free tiers)
ScalabilityLimited by your machineAuto-scaling, global reach
MaintenanceYou manage backups, upgradesManaged by cloud provider
Best forLearning, small projectsProduction apps, enterprise systems