シェルで MySQL 接続数をチェックする方法

次のコマンドでMySQL接続数を確認できます。

mysqladmin -u username -p password processlist

Where username and password are your MySQL username and password, respectively. After executing this command, you will see a list of current active MySQL connections, along with the number of connections.

また、次のコマンドを使用してMySQL接続数を調べることもできます。

mysql -u username -p password -e "show processlist" | wc -l

同様に、usernameとpasswordはそれぞれ、MySQLのユーザーネーム、パスワードです。このコマンドを実行すると、接続数の出力が表示されます。

bannerAds