cli-execution-mastery
Skill này làm gì
Skill này giải thích cách chạy công cụ kiểm tra MySQLTuner với các thiết lập cơ sở dữ liệu khác nhau. Nó dành cho quản trị viên cơ sở dữ liệu muốn việc kiểm tra kết nối một cách an toàn.
Khi nào nên dùng
- ✓Khi bạn cần chạy MySQLTuner trên cơ sở dữ liệu cục bộ, từ xa hoặc trong container.
- ✓Khi bạn muốn giữ mật khẩu cơ sở dữ liệu ngoài dòng lệnh.
- ✓Khi bạn muốn kết quả kiểm tra sức khỏe ở chế độ im lặng hoặc chi tiết.
Liên kết skill
https://github.com/major/MySQLTuner-perl/blob/master/.agent/skills/cli-execution-mastery/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chạy MySQLTuner trên máy chủ MySQL từ xa của tôi mà không gõ mật khẩu trong lệnh.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chọn các tùy chọn kết nối phù hợp với thiết lập của bạn, chẳng hạn socket, host hoặc container, và dùng file cài đặt hoặc biến môi trường cho thông tin đăng nhập thay vì dòng lệnh.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
CLI Execution Mastery Skill
🧠 Rationale
Mastering the CLI options of mysqltuner.pl allows for seamless execution across diverse environments while maintaining security and leveraging existing configurations.
🛠️ Implementation
1. Connection Discovery & Targeting
| Target Type | Primary Command/Options |
|---|---|
| Local Socket | perl mysqltuner.pl (Default) | --socket=/path/to/mysql.sock |
| Remote Host | perl mysqltuner.pl --host=1.2.3.4 --port=3306 |
| Container | perl mysqltuner.pl --container=container_name_or_id |
| Cloud/Azure | perl mysqltuner.pl --cloud --azure |
2. Authentication Strategies
[!IMPORTANT] Avoid passing passwords directly via
--passon the command line to prevent exposure in process lists.
Preferred:
.my.cnfUsage- Use
--defaults-file=/path/to/.my.cnfto point to a specific configuration file. - The script automatically respects common paths if not specified.
- Use
Environment Variables
- Use
--userenv=MY_USER_VARand--passenv=MY_PASS_VARto leverage pre-set credentials.
- Use
Password Files
- Use
--passwordfile=/path/to/passwords.txtfor batch security auditing.
- Use
3. Execution Contexts
- Standard Verbose Run:
perl mysqltuner.pl --verbose(Recommended for full diagnostics). - Silent Mode:
perl mysqltuner.pl --silent(Useful for automated data collection). - JSON Output:
perl mysqltuner.pl --jsonor--prettyjson(For integration with other tools).
4. Debugging Connections
If connection fails, use these flags to diagnose:
--debug: Enables full debug output.--dbgpattern='.*': Filters debug information with regex.- Verify
mysqlcmdpath if custom binaries are used:--mysqlcmd=/usr/local/bin/mysql.
5. MariaDB InnoDB Variable Compatibility
As MariaDB evolves, several InnoDB system variables have been removed or deprecated. mysqltuner.pl detects these to avoid legacy configuration overhead.
| Parameter | Removed/Deprecated In | Note/Replacement |
|---|---|---|
have_innodb |
Removed 10.0 | Use SHOW ENGINES or I_S.PLUGINS. |
innodb_adaptive_flushing_method |
Removed 10.0 | Replaced by MySQL 5.6 flushing logic. |
innodb_checksums |
Removed 10.0 | Use innodb_checksum_algorithm. |
innodb_stats_sample_pages |
Removed 10.5.0 | Use innodb_stats_transient_sample_pages. |
innodb_file_format / _check / _max |
Removed 10.6.0 | Antelope and Barracuda are legacy concepts. |
innodb_large_prefix |
Removed 10.6.0 | Always enabled in newer versions. |
innodb_locks_unsafe_for_binlog |
Removed 10.6.0 | No longer supported. |
innodb_prefix_index_cluster_optimization |
Deprecated 10.10 | Always enabled now. |
6. MySQL InnoDB Variable Compatibility
| Parameter | Removed/Deprecated In | Note/Replacement |
|---|---|---|
innodb_locks_unsafe_for_binlog |
Removed 8.0 | Use READ COMMITTED isolation level instead. |
innodb_support_xa |
Removed 8.0 | XA support is now always enabled. |
innodb_file_format family |
Removed 8.0 | Barracuda is the only supported format. |
innodb_large_prefix |
Removed 8.0 | Always enabled for Barracuda. |
tx_isolation / tx_read_only |
Removed 8.0 | Use transaction_isolation / transaction_read_only. |
innodb_undo_logs |
Removed 8.0 | Replaced by innodb_rollback_segments. |
innodb_undo_tablespaces |
Removed 9.0 | Managed automatically now. |
innodb_log_file_size |
Removed 9.0 | Replaced by innodb_redo_log_capacity. |
innodb_api_... variables |
Removed 8.4 | Memcached-related variables removed. |
✅ Verification
- Run
perl mysqltuner.pl --helpto confirm availability of these options. - Use
execute_system_commandto test connectivity with specific flags in the target environment.
Câu hỏi thường gặp
Vì sao nên tránh gõ mật khẩu trên dòng lệnh?
Mật khẩu trên dòng lệnh có thể bị nhìn thấy trong danh sách tiến trình đang chạy, nên skill ưu tiên file cài đặt hoặc biến môi trường.
Nó có kiểm tra được cơ sở dữ liệu trên cloud không?
Skill có bao gồm các tùy chọn cho cloud và Azure.
Có chế độ đầu ra yên lặng hơn không?
Có. Chế độ im lặng phù hợp cho thu thập tự động, còn chế độ chi tiết cho chẩn đoán đầy đủ.
Chi tiết
Mô tả gốc của tác giả
Mastery of MySQLTuner CLI options for connection and authentication.
repo: major/MySQLTuner-perl
Độ phổ biến
- Sao GitHub
- 9.5k
- Vị trí xếp hạng
- #12277
- Giấy phép
- GPL-3.0
- Cập nhật
- 28/10/2026
Bình luận
- …
Thêm skill từ kho mã này
analyze_buffer_pool
9.5kGiúp agent của bạn kiểm tra MySQL hoặc MariaDB dùng bộ nhớ đệm InnoDB hiệu quả đến đâu, phát hiện nghẽn ghi đĩa và gợi ý kích thước buffer pool.
detect_fragmented_tables
9.5kGiúp agent của bạn tìm các bảng lãng phí dung lượng do phân mảnh và gợi ý cách lấy lại dung lượng an toàn, kèm mức ảnh hưởng đến máy chủ.
diagnose_replication_lag
9.5kGiúp agent của bạn kiểm tra bản sao MySQL hoặc MariaDB có bị tụt sau máy chủ chính không, và tìm các luồng sao chép lỗi cùng thông báo lỗi của chúng.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.