Installing SQL
SQL Basics Course
Topic 5: Installing MySQL & Database Tools
Learn how to install MySQL and the tools used by developers to manage databases.
Learning Objectives
- Understand MySQL
- Install MySQL Server
- Install XAMPP
- Use phpMyAdmin
- Use MySQL Workbench
- Create your first database
What is MySQL?
MySQL is one of the world's most popular Relational Database Management Systems (RDBMS).
Application → MySQL Server → Database
It stores, manages and retrieves data using SQL.
Why Learn MySQL?
- Easy to learn
- Widely used in web development
- Works with PHP, Laravel, Python, Java and more
- Open source
- Excellent community support
MySQL Installation Steps (Windows)
- Download MySQL Community Installer.
- Run the installer.
- Select Developer Default setup.
- Install required components.
- Set root password.
- Complete installation.
Important Components
| Component | Purpose |
|---|---|
| MySQL Server | Stores databases |
| MySQL Workbench | GUI management tool |
| MySQL Shell | Command-line access |
| Connectors | Connect applications to MySQL |
What is XAMPP?
XAMPP is a package that contains Apache, MySQL/MariaDB, PHP and other tools.
XAMPP = Apache + MySQL + PHP + Perl
It is commonly used for local web development.
Installing XAMPP
- Download XAMPP.
- Run installer.
- Select MySQL and Apache.
- Complete installation.
- Start Apache and MySQL from Control Panel.
What is phpMyAdmin?
phpMyAdmin is a browser-based tool for managing MySQL databases.
http://localhost/phpmyadmin
It allows database creation, table management and SQL execution without command line tools.
What is MySQL Workbench?
MySQL Workbench is the official graphical client for MySQL.
- Create databases
- Run SQL queries
- Design schemas
- Manage users
- Visualize relationships
Connecting to MySQL
| Setting | Value |
|---|---|
| Host | localhost |
| Port | 3306 |
| Username | root |
| Password | Your Password |
Creating Your First Database
CREATE DATABASE school_db;
This command creates a database named school_db.
Common Installation Problems
- Port 3306 already in use
- Forgot root password
- MySQL service not starting
- Firewall blocking connections
- Incorrect installation path
Best Practices
- Use strong passwords
- Keep backups
- Update MySQL regularly
- Install only required components
- Practice using Workbench and phpMyAdmin
Practice Exercises
- Install MySQL Server.
- Install XAMPP.
- Open phpMyAdmin.
- Create a database named college_db.
- Connect using MySQL Workbench.
Quiz
1. What is MySQL?
2. What port does MySQL use by default?
3. What is phpMyAdmin used for?
4. What is XAMPP?
5. Which tool provides a graphical interface for MySQL?
Summary
- MySQL is a relational database system.
- XAMPP simplifies local development setup.
- phpMyAdmin provides browser-based database management.
- MySQL Workbench is the official GUI tool.
- You can create databases using SQL commands.