Mysql learning in terminal (WP Site was intended)
This is some basic, Here’s a practical MySQL cheat sheet tailored for setting up a WordPress database from scratch via terminal , covering login → database → user → privileges → DDL → DML → common operations. 🐬 MySQL Cheat Sheet (WordPress Setup + Core Commands) 🔐 1. After Logging Into MySQL mysql -u root -p Check current user: SELECT USER (); Show databases: SHOW DATABASES ; 🏗️ 2. Create WordPress Database CREATE DATABASE wordpress_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; Use it: USE wordpress_db ; 👤 3. Create MySQL User for WordPress CREATE USER 'wp_user' @ 'localhost' IDENTIFIED BY 'strong_password' ; Grant privileges: GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user' @ 'localhost' ; Apply changes: FLUSH PRIVILEGES ; Check grants: SHOW GRANTS FOR 'wp_user' @ 'localhost' ; 🗑️ 4. Delete Database / User (if needed) DROP DATABASE wordpress_db; DROP ...