1

有什么简单的方法可以在 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.
4

2 回答 2

0

您必须使用 CPAN 安装 perl 模块 DBD::mysql。

http://www.cpan.org/modules/INSTALL.html

于 2013-11-15T22:33:33.390 回答
0

2021 年更新
要在您的 Mac 上安装和配置Mytop,请按照以下步骤操作:

  1. 安装 Mytop 在终端上运行以下命令:
  • 第一次运行:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  • 然后运行:
brew install mytop
  1. 创建一个mytop配置文件,该文件必须在你的mac用户的文件夹是:/Users/your_user/
nano ~/.mytop
  1. 粘贴并替换为您的凭据
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)
于 2021-07-05T12:33:54.677 回答