Installing and Configuring MySQL 🛢️⚙️

Installing and Configuring MySQL 🛢️⚙️
1️⃣ Installing MySQL
✅ Installation on Windows
Download MySQL
Go to the official MySQL website.
Download MySQL Community Server (free version).
Run the Installer
Choose "Custom" or "Developer Default" setup.
Install MySQL Server, MySQL Workbench, and MySQL Shell (optional).
Configure MySQL Server
Select Standalone MySQL Server.
Set root password for authentication.
Choose default port 3306.
Complete the setup and start the MySQL service.
✅ Installation on macOS
Install via Homebrew (recommended):
brew install mysql
brew services start mysql
mysql_secure_installation
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
sudo systemctl start mysql
[mysqld]
port = 3306
max_connections = 100
bind-address = 127.0.0.1
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
mysql -u root -p
SHOW DATABASES;
USE database_name;
SHOW TABLES;
DESCRIBE table_name;
CREATE DATABASE mydatabase;
USE mydatabase;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR(100)
);
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
SELECT * FROM users;
Date: 2025-03-28 00:00:00.000000