Để cài đặt MySQL Command Line Client trên Windows:
- Truy cập trang tải chính thức: https://dev.mysql.com/downloads/mysql/
- Chọn hệ điều hành: Windows (x86, 32/64-bit)
- Tải file cài đặt MySQL Installer (phiên bản Web hoặc Full):
- Web Installer (nhỏ, tải component khi cài) - khuyến nghị.
- Full Installer (lớn, chứa sẵn tất cả).
- Chạy installer, chọn setup type:
- Developer Default: Cài Server, Workbench, Shell, Router, Samples... (khuyến nghị cho dev).
- Server Only: Chỉ cài MySQL Server.
- Client Only: Chỉ công cụ client (mysql, mysqldump...).
- Hoàn tất cài đặt, cấu hình root password, port (mặc định 3306), Windows Service.
Sau cài đặt, mở Command Prompt (cmd) hoặc PowerShell, chạy:
mysql -u root -p
Nhập mật khẩu → vào được MySQL shell (mysql>).
Lưu ý: Thêm thư mục bin của MySQL vào PATH hệ thống để chạy mysql từ bất kỳ đâu.