Install Mytop di cPanel
Rizky 9 November 2018
Perintah mytop berguna untuk melihat aktifitas query mysql yang terjadi di server. Berikut cara instalasi mytop di server berbasis cPanel.
Install MyTop.
wget http://fossies.org/linux/privat/mytop-1.9.1.tar.gz
tar zxpfv mytop-1.9.1.tar.gz
cd mytop-1.9.1
perl Makefile.PL && make && make install
Setelah selesai coba jalankan perintah mytop. Apabila ada error seperti ini.
Error in option spec: "long|!"
Edit file /usr/bin/mytop.
nano /usr/bin/mytop
Cari baris berikut;
"long|!" => \$config{long_nums}
Berikan tanda komentar (#) di awal baris, menjadi seperti berikut;
#"long|!" => \$config{long_nums}
Coba jalankan kembali. Apabila ada error seperti berikut ;
Cannot connect to MySQL server. Please check the:
* database you specified "test" (default is "test")
* username you specified "root" (default is "root")
* password you specified "" (default is "")
* hostname you specified "localhost" (default is "localhost")
* port you specified "3306" (default is 3306)
* socket you specified "" (default is "")
The options my be specified on the command-line or in a ~/.mytop
config file. See the manual (perldoc mytop) for details.
Here's the exact error from DBI. It might help you debug:
Unknown database 'test'
Buat file /root/.mytop
nano /root/.mytop
Dan isi file tersebut dengan script berikut;
user=root
pass=
host=localhost
db=mysql
delay=5
port=3306
socket=
batchmode=0
header=1
color=1
idle=1
Lalu coba jalankan kembali perintah mytop.