cli-execution-mastery
できること
このスキルは、さまざまなデータベース環境に対してMySQLTunerのチェックツールを実行する方法を説明します。チェックが安全に接続するようにしたいデータベース管理者向けです。
使う場面
- ✓ローカル、リモート、コンテナ化されたデータベースに対してMySQLTunerを実行する必要があるとき。
- ✓データベースのパスワードをコマンドラインに残さないようにしたいとき。
- ✓健全性チェックの出力を簡潔にするか、詳しくするかを選びたいとき。
スキルのリンク
https://github.com/major/MySQLTuner-perl/blob/master/.agent/skills/cli-execution-mastery/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“リモートのMySQLサーバーに対してMySQLTunerを実行してください。パスワードはコマンドに直接入力しないでください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、ソケット、ホスト、コンテナなどお使いの環境に合った接続オプションを選びます。ログイン情報はコマンドラインではなく、設定ファイルまたは環境変数を使います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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.
よくある質問
なぜコマンドラインにパスワードを入力しないのですか?
コマンドラインのパスワードは、実行中のプロセス一覧から見えてしまう可能性があるため、このスキルは設定ファイルや環境変数を優先します。
クラウドのデータベースもチェックできますか?
はい。このスキルにはクラウドやAzureのオプションが含まれています。
出力を静かにするオプションはありますか?
はい。サイレントモードは自動収集に向いており、詳細モードは完全な診断情報を出します。
詳細
作者による元の説明
Mastery of MySQLTuner CLI options for connection and authentication.
repo: major/MySQLTuner-perl
人気
- GitHubのスター
- 9.5k
- ランキング
- #12277
- ライセンス
- GPL-3.0
- 更新日
- 2026/10/28
コメント
- …
このリポジトリの他のスキル
analyze_buffer_pool
9.5kエージェントが、MySQLやMariaDBのInnoDBキャッシュの使われ方を確認し、書き込みの停滞を見つけ、適切なバッファプールのサイズを提案できるよう支援します。
detect_fragmented_tables
9.5kエージェントが、断片化で無駄な容量を使っているデータベースの表を見つけ、安全な回収方法と、サーバーへの影響を提案できるよう支援します。
diagnose_replication_lag
9.5kエージェントが、MySQLまたはMariaDBのレプリカが本番サーバーより遅れていないかを確認し、停止したスレッドとそのエラーを見つけられるよう支援します。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。