Introduction to MySQL
Hey there! Welcome to the very first chapter of our MySQL tutorial. Let’s start from the basics and go step-by-step, just like we’re sitting together and chatting about databases over a cup of chai. I’ll explain everything in a friendly, human way so it feels easy and natural.
1. What is MySQL?
MySQL is one of the most popular open-source relational database management systems (RDBMS) in the world. In simple words: it’s a super-efficient software that helps you store, organize, and retrieve large amounts of data in a structured way (like rows and columns in a table).
- Open-source → It’s completely free to use, modify, and distribute. Anyone can download it, look at the code, and even contribute improvements.
- Relational → Data is stored in tables that can be connected to each other using relationships (like linking customers to their orders).
- RDBMS → It follows rules to keep data consistent, accurate, and secure.
A bit of history (just enough to impress your friends 😄):
- MySQL was created in 1995 by two Swedish developers, Michael “Monty” Widenius and David Axmark, while working for a company called TCX DataKonsult AB.
- The name MySQL comes from “My” (Monty’s daughter My) + SQL.
- In 2008, Sun Microsystems bought MySQL for about $1 billion.
- Then in 2010, Oracle acquired Sun (and thus MySQL).
- Even today (in 2026), MySQL is actively developed and maintained by Oracle, but there’s also a popular community fork called MariaDB (created by the original developers).
Current status: The latest stable versions are in the 8.4 LTS series (long-term support, very stable for production) and the innovation track like 9.4+ with the newest features. MySQL 8.0 series is still widely used but reaching end-of-life in 2026, so most new projects start with 8.4 or 9.x.
2. Key Features of MySQL
MySQL is loved because it’s:
- Super fast — especially for read-heavy applications
- Reliable — ACID compliant (Atomicity, Consistency, Isolation, Durability) when using InnoDB (the default storage engine)
- Scalable — Handles millions of queries per second and can run on a single laptop or a huge cluster
- Easy to use — Simple syntax, huge community support
- Cross-platform — Works on Windows, Linux, macOS, etc.
- Great ecosystem — Works perfectly with PHP, Python, Node.js, Java, etc.
- Advanced features in recent versions: JSON support, window functions, common table expressions (CTE), full-text search, replication, partitioning, and more
3. Difference between SQL and MySQL
This is a question almost everyone gets confused about at first — so let’s clear it up simply:
| Aspect | SQL | MySQL |
|---|---|---|
| What is it? | A language (Structured Query Language) | A software/product (database server) |
| Full form | Structured Query Language | My + SQL (but it’s the name of the RDBMS) |
| Purpose | The standard way to talk to relational databases (SELECT, INSERT, UPDATE, DELETE, etc.) | An actual program that stores your data and understands SQL commands |
| Example | Like English — the language | Like Microsoft Word — a program that understands English |
| Other examples | PostgreSQL, Oracle, SQL Server, MariaDB, SQLite also use SQL | MySQL is one specific implementation of SQL |
| Standard | Defined by ANSI/ISO standards | MySQL follows most SQL standards but adds its own extensions (e.g., LIMIT instead of FETCH FIRST) |
Simple analogy: SQL is the language you speak. MySQL is the person who understands that language (and speaks it back to you).
You use SQL to give commands to MySQL.
4. Why use MySQL? (Popularity, Performance, Scalability)
Even in 2026, MySQL remains one of the top 3 most popular databases in the world (usually #2 or #3 on DB-Engines ranking, after Oracle and sometimes Microsoft SQL Server, but ahead of PostgreSQL in many lists).
Why is it so popular?
- Huge community & ecosystem — Millions of developers, forums, Stack Overflow answers, tutorials
- Used by giants — YouTube, Facebook, Twitter (X), Netflix, Spotify, WordPress (powers ~43% of all websites!), Airbnb, Uber, and thousands of startups
- Performance — Extremely fast for web apps, read-heavy workloads, and simple queries
- Scalability — Easy horizontal scaling with replication (master-slave, group replication), sharding, and tools like Vitess or ProxySQL
- Free & open-source — No licensing costs (Community Edition)
- Easy to learn & deploy — Beginner-friendly yet powerful enough for enterprise
- Cloud-friendly — Amazon RDS, Google Cloud SQL, Azure Database for MySQL, Oracle MySQL HeatWave, etc.
5. Installation (MySQL Community Server, MySQL Workbench, XAMPP/MAMP)
There are a few common ways to get MySQL running on your computer.
Option 1: Official MySQL Community Server + Workbench (Recommended for serious learners)
- Go to → https://dev.mysql.com/downloads/
- Download MySQL Installer for Windows (or use the separate MSI/ZIP for macOS/Linux)
- Run the installer → Choose Developer Default setup (includes Server + Workbench + Shell + Connectors)
- During installation, set a strong root password
- Finish and launch MySQL Workbench — it’s a beautiful GUI tool to manage databases, write queries, design tables visually, etc.
Option 2: XAMPP (Super easy for beginners, especially web developers)
- XAMPP = Apache + MySQL + PHP + Perl
- Download from → https://www.apachefriends.org/
- Install → It includes MySQL (actually MariaDB in recent versions, but fully compatible)
- Start the control panel → Click Start on MySQL
- Access phpMyAdmin in browser: http://localhost/phpmyadmin
- Perfect for learning PHP + MySQL together
For macOS: Use MAMP (similar to XAMPP) or install via Homebrew:
|
0 1 2 3 4 5 6 |
brew install mysql |
For Linux:
|
0 1 2 3 4 5 6 |
sudo apt update && sudo apt install mysql-server # Ubuntu/Debian |
6. Connecting to MySQL (mysql command-line client)
Once installed, the easiest way to start playing is through the command line.
On Windows (after official installer):
- Open Command Prompt or PowerShell
- Type:
Bash0123456mysql -u root -p
- Enter the root password you set during installation
- You’re in! You’ll see mysql>
On macOS/Linux: Same command: mysql -u root -p
Basic commands to try immediately:
|
0 1 2 3 4 5 6 7 8 9 10 |
SHOW DATABASES; -- List all databases CREATE DATABASE myfirstdb; -- Create your first database USE myfirstdb; -- Switch to it SHOW TABLES; -- (empty at first) EXIT; -- Quit |
Alternative: Use MySQL Workbench — connect with:
- Hostname: 127.0.0.1 or localhost
- Port: 3306 (default)
- Username: root
- Password: (your password)
And you get a nice graphical interface to run queries, see tables, etc.
That’s it for Chapter 1! 🎉 You now know what MySQL is, why it’s awesome, and how to get it running on your machine.
