cpanel-database
Tạo và quản lý MySQL database, MySQL user và phân quyền trên gói hosting cPanel. Dùng khi người dùng cần tạo database, tạo user MySQL, cấp quyền, kết nối website (WordPress, Laravel...) tới database, hoặc xóa database trên cPanel.
Works with
--- name: cpanel-database description: Tạo và quản lý MySQL database, MySQL user và phân quyền trên gói hosting cPanel. Dùng khi người dùng cần tạo database, tạo user MySQL, cấp quyền, kết nối website (WordPress, Laravel...) tới database, hoặc xóa database trên cPanel. license: MIT --- # cPanel — Quản lý MySQL Database Tạo database, user và cấp quyền qua `bin/cpanel`. > **Tiền tố bắt buộc:** cPanel yêu cầu mọi database/user mang tiền tố `<cpaneluser>_`. > UAPI **không tự thêm** (chỉ giao diện web mới tự thêm). CLI này **tự ghép tiền tố** > cho bạn — lấy động qua `Mysql::get_restrictions`. Bạn truyền tên ngắn (`blog`) hay > tên đầy đủ (`user_blog`) đều được; CLI in ra tên đầy đủ đã dùng. ## Quy trình chuẩn tạo database cho một ứng dụng ```bash # 1. Tạo database (CLI tự thành <user>_blog) cpanel db:create blog # 2. Tạo MySQL user (CLI tự thành <user>_bloguser) cpanel db:user-create bloguser 'M@tKhauManh123!' # 3. Cấp toàn quyền — truyền tên ngắn cũng được, CLI tự ghép tiền tố cho cả hai cpanel db:grant bloguser blog ``` Sau đó dùng thông tin này trong cấu hình ứng dụng: - Host: `localhost` - Database: `user_blog` - User: `user_bloguser` - Password: mật khẩu đã đặt ## Các lệnh | Lệnh | Mô tả | |------|-------| | `db:list` | Liệt kê database hiện có | | `db:create <name>` | Tạo database | | `db:user-create <user> <pass>` | Tạo MySQL user | | `db:user-passwd <user> <pass>` | Đổi mật khẩu MySQL user | | `db:user-delete <user>` | Xóa MySQL user | | `db:grant <user> <db> [priv]` | Cấp quyền (mặc định `ALL PRIVILEGES`) | | `db:delete <name>` | **Xóa database — phải xác nhận trước** | ## Lưu ý - Trước khi tạo, chạy `db:list` để tránh trùng tên. - Mật khẩu nên ≥ 12 ký tự, có hoa/thường/số/ký tự đặc biệt (cPanel có thể từ chối mật khẩu yếu). Đặt mật khẩu trong dấu nháy đơn để shell không diễn giải ký tự đặc biệt. - **Không bao giờ** chạy `db:delete`/`db:user-delete` mà chưa xác nhận rõ ràng với người dùng. Engine sẽ chặn nếu thiếu xác nhận; sau khi người dùng đồng ý, chạy lại kèm `--yes` (vd `cpanel db:delete blog --yes`). Xem trước: thêm `--dry-run`. - Để chỉ cấp quyền hạn chế: `db:grant <user> <db> "SELECT, INSERT, UPDATE, DELETE"`. - Trong file cấu hình ứng dụng, **luôn dùng tên đầy đủ có tiền tố** (ví dụ `<user>_blog`) — đây là tên thật trong MySQL. Chạy `db:list` để lấy tên chính xác. ## Truy cập MySQL từ xa (Remote MySQL) ```bash cpanel db:remote-add 203.0.113.10 --yes # cho phép host/IP kết nối MySQL từ xa cpanel db:remote-delete 203.0.113.10 --yes # thu hồi ``` - Dùng khi cần kết nối DB từ máy ngoài (Navicat, ứng dụng khác...). **Ghi quyền → qua cổng `--yes`.** - **Bảo mật:** chỉ mở cho IP tin cậy cụ thể, KHÔNG mở `%` (mọi IP). UAPI không có lệnh liệt kê host từ xa — quản lý danh sách qua giao diện cPanel > Remote MySQL nếu cần xem.
More Database skills
azure-upgrade
microsoft/azure-skills
Assess and upgrade Azure workloads between plans, tiers, or SKUs, or modernize Azure SDK dependencies in source code. WHEN: upgrade Consumption to Flex Consumption, upgrade Azure Functions plan, change hosting plan, function app SKU, migrate App Service to Container Apps, modernize legacy Azure Java SDKs (com.microsoft.azure to com.azure), migrate Azure Cache for Redis (ACR/ACRE) to Azure Managed Redis (AMR).
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-database-setup
prisma/skills
Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".

