SQL Installation & Setup
SQL installation and setup guide for MySQL on Windows, macOS, Linux
Before you can start learning SQL queries or building database-driven applications, you need to install SQL and set up a working database environment. This guide will walk you through everything required to install, configure, and start using SQL on your system.
This SEO-friendly tutorial covers:
What you need before installation
Installing MySQL (most popular SQL database)
Setting up MySQL Workbench / phpMyAdmin
Basic configuration
Verifying installation
Beginners’ first SQL commands
Most SQL tutorials use MySQL because it is:
Free
Widely used
Beginner-friendly
Works with PHP, Node.js, Python, Java, and more
You can install SQL on:
Windows
macOS
Linux (Ubuntu / Debian / CentOS)
Go to the official MySQL website:
https://dev.mysql.com/downloads/
Download the appropriate installer for your OS.
Download MySQL Installer (Community Edition).
Download DMG Archive version.
Use package manager (shown below).
Run the MySQL Installer
Choose Developer Default
Install MySQL Server + Workbench
Set root password
Complete installation
Open .dmg file
Run the installer wizard
Set a root password
Finish installation
sudo apt update
sudo apt install mysql-server
Secure the installation:
sudo mysql_secure_installation
MySQL Workbench helps you:
Run SQL queries
Create tables visually
View database structures
Manage connections
Download from:
https://dev.mysql.com/downloads/workbench/
MySQL runs automatically after installation.
brew services start mysql
sudo systemctl start mysql
sudo systemctl enable mysql
Check the status:
sudo systemctl status mysql
mysql -u root -p
Enter your root password.
You are now inside the MySQL CLI.
Open MySQL Workbench
Click Local Instance
Enter password
Start running queries
CREATE DATABASE tutorial_db;
Select the database:
USE tutorial_db;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100)
);
INSERT INTO users (name, email)
VALUES ('Shubham', 'shubham@example.com');
SELECT * FROM users;
Check port 3306 availability
Restart the server
Reinstall the MySQL service
Use:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';
Update Workbench version
Increase system RAM
In this SQL installation and setup guide, you learned:
How to install MySQL on Windows, macOS, and Linux
How to set up MySQL Workbench
How to log in and start MySQL server
How to create your first database and table
How to run basic SQL queries
You are now ready to start learning SQL commands, joins, filtering, and more advanced concepts.