有什么简单的方法可以在 MAC OS 10.8 上安装mytop 。我尝试使用 brew 但它显示错误。
Unsatisfied dependency: DBD::mysql
Homebrew does not provide Perl dependencies; install with:
cpan -i DBD::mysql
Error: An unsatisfied requirement failed this build.
有什么简单的方法可以在 MAC OS 10.8 上安装mytop 。我尝试使用 brew 但它显示错误。
Unsatisfied dependency: DBD::mysql
Homebrew does not provide Perl dependencies; install with:
cpan -i DBD::mysql
Error: An unsatisfied requirement failed this build.
您必须使用 CPAN 安装 perl 模块 DBD::mysql。
2021 年更新
要在您的 Mac 上安装和配置Mytop,请按照以下步骤操作:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install mytop
nano ~/.mytop
user=your_database_user
pass=your_database_password
host=localhost
db=your_database
delay=5
port=3306
socket=/Applications/MAMP/tmp/mysql/mysql.sock
batchmode=0
header=1
color=1
idle=1
最后保存运行:
mytop
Help for mytop version 1.91
? - display this screen
# - toggle short/long numbers (not yet implemented)
c - command summary view (based on Com_* counters)
C - turn color on and off
d - show only a specific database
e - explain the query that a thread is running
E - display current replication error
f - show full query info for a given thread
F - unfilter the display
h - show only a specifc host's connections
H - toggle the mytop header
i - toggle the display of idle (sleeping) threads
I - show innodb status
k - kill a thread
p - pause the display
l - change long running queries hightlighing
m - switch [mode] to qps (queries/sec) scrolling view
o - reverse the sort order (toggle)
q - quit
r - reset the status counters (via FLUSH STATUS on your server)
R - change reverse IP lookup
s - change the delay between screen updates
S - change slow query hightlighting
t - switch to thread view (default)
u - show only a specific user
: - enter a command (not yet implemented)
! - Skip an error that has stopped replications (at your own risk)